diff --git a/src/rng/backends/curand/curand_task.hpp b/src/rng/backends/curand/curand_task.hpp index adc08b840..5e6858c7c 100644 --- a/src/rng/backends/curand/curand_task.hpp +++ b/src/rng/backends/curand/curand_task.hpp @@ -36,7 +36,11 @@ static inline void host_task_internal(H &cgh, E e, F f) { #else template static inline void host_task_internal(H &cgh, A acc, E e, F f) { +#ifdef SYCL_EXT_ONEAPI_ENQUEUE_NATIVE_COMMAND + cgh.ext_codeplay_enqueue_native_command([=](sycl::interop_handle ih){ +#else cgh.host_task([=](sycl::interop_handle ih) { +#endif curandStatus_t status; auto stream = ih.get_native_queue(); CURAND_CALL(curandSetStream, status, e, stream); @@ -48,7 +52,11 @@ static inline void host_task_internal(H &cgh, A acc, E e, F f) { template static inline void host_task_internal(H &cgh, E e, F f) { +#ifdef SYCL_EXT_ONEAPI_ENQUEUE_NATIVE_COMMAND + cgh.ext_codeplay_enqueue_native_command([=](sycl::interop_handle ih){ +#else cgh.host_task([=](sycl::interop_handle ih) { +#endif curandStatus_t status; auto stream = ih.get_native_queue(); CURAND_CALL(curandSetStream, status, e, stream); diff --git a/src/rng/backends/rocrand/rocrand_task.hpp b/src/rng/backends/rocrand/rocrand_task.hpp index 2588dc901..c97e7b793 100644 --- a/src/rng/backends/rocrand/rocrand_task.hpp +++ b/src/rng/backends/rocrand/rocrand_task.hpp @@ -36,7 +36,11 @@ static inline void host_task_internal(H &cgh, E e, F f) { #else template static inline void host_task_internal(H &cgh, A acc, E e, F f) { +#ifdef SYCL_EXT_ONEAPI_ENQUEUE_NATIVE_COMMAND + cgh.ext_codeplay_enqueue_native_command([=](sycl::interop_handle ih){ +#else cgh.host_task([=](sycl::interop_handle ih) { +#endif rocrand_status status; auto stream = ih.get_native_queue(); ROCRAND_CALL(rocrand_set_stream, status, e, stream); @@ -51,7 +55,11 @@ static inline void host_task_internal(H &cgh, A acc, E e, F f) { template static inline void host_task_internal(H &cgh, E e, F f) { +#ifdef SYCL_EXT_ONEAPI_ENQUEUE_NATIVE_COMMAND + cgh.ext_codeplay_enqueue_native_command([=](sycl::interop_handle ih){ +#else cgh.host_task([=](sycl::interop_handle ih) { +#endif rocrand_status status; auto stream = ih.get_native_queue(); ROCRAND_CALL(rocrand_set_stream, status, e, stream);