Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
6568a69d
Commit
6568a69d
authored
Oct 10, 2022
by
Paul
Browse files
Seperate host/device time
parent
6fa85d83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
src/targets/gpu/driver/perf.cpp
src/targets/gpu/driver/perf.cpp
+10
-2
No files found.
src/targets/gpu/driver/perf.cpp
View file @
6568a69d
...
@@ -56,14 +56,22 @@ time_op(context& ictx, operation op, const std::vector<shape>& inputs, int n)
...
@@ -56,14 +56,22 @@ time_op(context& ictx, operation op, const std::vector<shape>& inputs, int n)
op
.
compute
(
ctx
,
output
,
args
);
op
.
compute
(
ctx
,
output
,
args
);
ctx
.
finish
();
ctx
.
finish
();
};
};
gctx
.
enable_perf_measurement
();
run
();
run
();
// Measure host time
double
host_time
=
0.0
;
double
host_time
=
0.0
;
double
device_time
=
0.0
;
for
(
auto
i
:
range
(
n
))
for
(
auto
i
:
range
(
n
))
{
{
(
void
)
i
;
(
void
)
i
;
host_time
+=
time
<
milliseconds
>
(
run
);
host_time
+=
time
<
milliseconds
>
(
run
);
}
// Measure device time
gctx
.
enable_perf_measurement
();
run
();
double
device_time
=
0.0
;
for
(
auto
i
:
range
(
n
))
{
(
void
)
i
;
run
();
device_time
+=
gctx
.
get_elapsed_ms
();
device_time
+=
gctx
.
get_elapsed_ms
();
}
}
return
std
::
make_pair
(
host_time
/
n
,
device_time
/
n
);
return
std
::
make_pair
(
host_time
/
n
,
device_time
/
n
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment