Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
227be0c1
Commit
227be0c1
authored
5 years ago
by
Elizabeth
Browse files
Options
Downloads
Patches
Plain Diff
Added option to input command line args to binary to run
parent
b58b4d27
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/projects/gpu_profiler/offline_profiler.cpp
+17
-7
17 additions, 7 deletions
llvm/projects/gpu_profiler/offline_profiler.cpp
with
17 additions
and
7 deletions
llvm/projects/gpu_profiler/offline_profiler.cpp
+
17
−
7
View file @
227be0c1
...
@@ -201,11 +201,11 @@ private:
...
@@ -201,11 +201,11 @@ private:
}
}
// Executes the program to be profiled
// Executes the program to be profiled
void
runProgram
(
const
char
*
const
program
)
{
void
runProgram
(
const
std
::
string
&
program
)
{
// Tell the profiling thread to start, execute the program that needs
// Tell the profiling thread to start, execute the program that needs
// to be profiled, and then tell the profiling thread to stop.
// to be profiled, and then tell the profiling thread to stop.
start_
=
true
;
start_
=
true
;
const
auto
result
=
std
::
system
(
program
);
const
auto
result
=
std
::
system
(
program
.
c_str
()
);
stop_
=
true
;
stop_
=
true
;
}
}
...
@@ -471,7 +471,7 @@ public:
...
@@ -471,7 +471,7 @@ public:
sys_stream_
.
close
();
sys_stream_
.
close
();
}
}
void
profile
(
const
char
*
const
program
,
const
int
iterations
)
{
void
profile
(
const
std
::
string
&
program
,
const
int
iterations
)
{
iterations_
=
iterations
;
iterations_
=
iterations
;
resetGlobal
();
resetGlobal
();
...
@@ -568,16 +568,26 @@ public:
...
@@ -568,16 +568,26 @@ public:
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
<
NUM_ARGS
)
{
if
(
argc
<
NUM_ARGS
)
{
std
::
cout
<<
"Usage: "
<<
argv
[
0
]
<<
" <program> <iterations> <tensor output file> [power output file]
\n
"
;
std
::
cout
<<
"Usage: "
<<
argv
[
0
]
<<
" <program>
<params> END_PARAM
<iterations> <tensor output file> [power output file]
\n
"
;
exit
(
1
);
exit
(
1
);
}
}
std
::
string
program
(
argv
[
1
]);
size_t
i
=
2
;
for
(;
i
<
argc
;
i
++
){
if
(
std
::
string
(
argv
[
i
])
==
"END_PARAM"
){
break
;
}
program
+=
" "
+
std
::
string
(
argv
[
i
]);
}
i
+=
1
;
Profiler
pp
;
Profiler
pp
;
pp
.
profile
(
argv
[
1
]
,
std
::
stoi
(
argv
[
2
]));
pp
.
profile
(
program
,
std
::
stoi
(
argv
[
i
+
1
]));
pp
.
dumpTensorInfo
(
argv
[
3
]);
pp
.
dumpTensorInfo
(
argv
[
i
+
2
]);
if
(
argc
>
NUM_ARGS
)
if
(
argc
>
NUM_ARGS
)
pp
.
dumpPowerReadings
(
argv
[
4
]);
pp
.
dumpPowerReadings
(
argv
[
i
+
3
]);
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment