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