From ed22ca5b8c578f172462673ca69347cd6591d718 Mon Sep 17 00:00:00 2001 From: MikeDvorskiy Date: Fri, 27 Dec 2024 17:23:45 +0100 Subject: [PATCH] ++ --- .../hetero/dpcpp/parallel_backend_sycl_utils.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_utils.h b/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_utils.h index f55bb7e98f..43a5ea5378 100644 --- a/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_utils.h +++ b/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_utils.h @@ -519,15 +519,15 @@ struct __usm_or_buffer_accessor // a `__future` for keeping alive temporary data, while allowing run-time branches to lead to // differently typed temporary storage for kernels. Virtual destructor is required to call // derived class destructor when leaving scope. +template struct __result_and_scratch_storage_base { virtual ~__result_and_scratch_storage_base() = default; - template - virtual _T __wait_and_get_value(_Event&&, size_t) const = 0; + virtual _T __wait_and_get_value(sycl::event&&, std::size_t) const = 0; }; template -struct __result_and_scratch_storage : __result_and_scratch_storage_base +struct __result_and_scratch_storage : __result_and_scratch_storage_base<_T> { private: using __sycl_buffer_t = sycl::buffer<_T, 1>; @@ -684,9 +684,7 @@ struct __result_and_scratch_storage : __result_and_scratch_storage_base } } - template - virtual _Val - __wait_and_get_value(_Event&& __event, size_t idx = 0) const + virtual _T __wait_and_get_value(sycl::event&& __event, std::size_t idx = 0) const { if (is_USM()) __event.wait_and_throw(); @@ -728,14 +726,14 @@ class __future : private std::tuple<_Args...> constexpr auto __wait_and_get_value(const __result_and_scratch_storage<_ExecutionPolicy, _T>& __storage) { - return __storage.__wait_and_get_value<_T>(__my_event); + return __storage.__wait_and_get_value(__my_event); } template constexpr auto __wait_and_get_value(const std::shared_ptr<__result_and_scratch_storage_base>& __storage) { - return __storage.__wait_and_get_value<_T>(__my_event); + return __storage.__wait_and_get_value(__my_event); } template