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
composable_kernel_ROCM
Commits
a32b1bc6
Unverified
Commit
a32b1bc6
authored
Jun 26, 2024
by
Po Yen Chen
Committed by
GitHub
Jun 26, 2024
Browse files
Replace hipDeviceSynchronize() by hipStreamSynchronize(stream) calls (#1359)
parent
0cb2e06d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
include/ck_tile/host/timer.hpp
include/ck_tile/host/timer.hpp
+5
-5
No files found.
include/ck_tile/host/timer.hpp
View file @
a32b1bc6
...
@@ -27,7 +27,7 @@ struct gpu_timer
...
@@ -27,7 +27,7 @@ struct gpu_timer
CK_TILE_HOST
void
start
(
const
hipStream_t
&
s
)
CK_TILE_HOST
void
start
(
const
hipStream_t
&
s
)
{
{
HIP_CHECK_ERROR
(
hip
Device
Synchronize
());
HIP_CHECK_ERROR
(
hip
Stream
Synchronize
(
s
));
HIP_CHECK_ERROR
(
hipEventRecord
(
start_evt
,
s
));
HIP_CHECK_ERROR
(
hipEventRecord
(
start_evt
,
s
));
}
}
...
@@ -51,15 +51,15 @@ struct gpu_timer
...
@@ -51,15 +51,15 @@ struct gpu_timer
struct
cpu_timer
struct
cpu_timer
{
{
// torch.utils.benchmark.Timer(), there is a sync inside each timer callback
// torch.utils.benchmark.Timer(), there is a sync inside each timer callback
CK_TILE_HOST
void
start
(
const
hipStream_t
&
)
CK_TILE_HOST
void
start
(
const
hipStream_t
&
s
)
{
{
HIP_CHECK_ERROR
(
hip
Device
Synchronize
());
HIP_CHECK_ERROR
(
hip
Stream
Synchronize
(
s
));
start_tick
=
std
::
chrono
::
high_resolution_clock
::
now
();
start_tick
=
std
::
chrono
::
high_resolution_clock
::
now
();
}
}
// torch.utils.benchmark.Timer(), there is a sync inside each timer callback
// torch.utils.benchmark.Timer(), there is a sync inside each timer callback
CK_TILE_HOST
void
stop
(
const
hipStream_t
&
)
CK_TILE_HOST
void
stop
(
const
hipStream_t
&
s
)
{
{
HIP_CHECK_ERROR
(
hip
Device
Synchronize
());
HIP_CHECK_ERROR
(
hip
Stream
Synchronize
(
s
));
stop_tick
=
std
::
chrono
::
high_resolution_clock
::
now
();
stop_tick
=
std
::
chrono
::
high_resolution_clock
::
now
();
}
}
// return in ms
// return in ms
...
...
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