From bb561afdde750b760d9492bb238cbd1c3836674a Mon Sep 17 00:00:00 2001 From: ShanoToni Date: Mon, 16 Sep 2024 17:18:03 +0100 Subject: [PATCH] gpu: nvidia: Added support for native host task extension --- src/gpu/nvidia/sycl_cuda_compat.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gpu/nvidia/sycl_cuda_compat.hpp b/src/gpu/nvidia/sycl_cuda_compat.hpp index 197008123c0..5e6196f313d 100644 --- a/src/gpu/nvidia/sycl_cuda_compat.hpp +++ b/src/gpu/nvidia/sycl_cuda_compat.hpp @@ -35,9 +35,13 @@ T get_native_mem(const interop_handle &ih, U acc) { ih.get_native_mem<::sycl::backend::ext_oneapi_cuda>(acc)); } -template -void host_task(::sycl::handler &cgh, const T &task) { +template +void host_task(HandlerT &cgh, const FnT &task) { +#ifdef SYCL_EXT_ONEAPI_ENQUEUE_NATIVE_COMMAND + cgh.ext_codeplay_enqueue_native_command(task); +#else cgh.host_task(task); +#endif } template