Skip to content

Commit

Permalink
Only call sync for std host_task
Browse files Browse the repository at this point in the history
Signed-off-by: JackAKirk <[email protected]>
  • Loading branch information
JackAKirk committed Oct 9, 2024
1 parent 94a4b68 commit 2d60b18
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rng/backends/rocrand/rocrand_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ static inline void host_task_internal(H &cgh, A acc, E e, F f) {
auto r_ptr = reinterpret_cast<typename A::value_type *>(
ih.get_native_mem<sycl::backend::ext_oneapi_hip>(acc));
f(r_ptr);

#ifndef SYCL_EXT_ONEAPI_ENQUEUE_NATIVE_COMMAND
hipError_t err;
HIP_ERROR_FUNC(hipStreamSynchronize, err, stream);
#endif
});
}

Expand All @@ -64,9 +65,10 @@ static inline void host_task_internal(H &cgh, E e, F f) {
auto stream = ih.get_native_queue<sycl::backend::ext_oneapi_hip>();
ROCRAND_CALL(rocrand_set_stream, status, e, stream);
f(ih);

#ifndef SYCL_EXT_ONEAPI_ENQUEUE_NATIVE_COMMAND
hipError_t err;
HIP_ERROR_FUNC(hipStreamSynchronize, err, stream);
#endif
});
}
#endif
Expand Down

0 comments on commit 2d60b18

Please sign in to comment.