From 2d60b1868f548e1098aa215b02778ecf4e339c0c Mon Sep 17 00:00:00 2001 From: JackAKirk Date: Wed, 9 Oct 2024 06:39:30 -0400 Subject: [PATCH] Only call sync for std host_task Signed-off-by: JackAKirk --- src/rng/backends/rocrand/rocrand_task.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rng/backends/rocrand/rocrand_task.hpp b/src/rng/backends/rocrand/rocrand_task.hpp index c97e7b793..bad40a9e5 100644 --- a/src/rng/backends/rocrand/rocrand_task.hpp +++ b/src/rng/backends/rocrand/rocrand_task.hpp @@ -47,9 +47,10 @@ static inline void host_task_internal(H &cgh, A acc, E e, F f) { auto r_ptr = reinterpret_cast( ih.get_native_mem(acc)); f(r_ptr); - +#ifndef SYCL_EXT_ONEAPI_ENQUEUE_NATIVE_COMMAND hipError_t err; HIP_ERROR_FUNC(hipStreamSynchronize, err, stream); +#endif }); } @@ -64,9 +65,10 @@ static inline void host_task_internal(H &cgh, E e, F f) { auto stream = ih.get_native_queue(); 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