From 81aeef02a30c2102f5e75aed9ac02a39e20a058d Mon Sep 17 00:00:00 2001 From: Matthew Michel Date: Mon, 15 Apr 2024 17:43:29 -0500 Subject: [PATCH 1/2] Use _ONEDPL_SYCL_UNIFIED_USM_BUFFER_PRESENT macro instead of _ONEDPL_SYCL_USM_HOST_PRESENT Signed-off-by: Matthew Michel --- .../dpl/pstl/hetero/dpcpp/parallel_backend_sycl_utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 0270ce1eee1..473332d9534 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 @@ -543,7 +543,7 @@ struct __result_and_scratch_storage inline bool __use_USM_allocations(sycl::queue __queue) { -#if _ONEDPL_SYCL_USM_HOST_PRESENT +#if _ONEDPL_SYCL_UNIFIED_USM_BUFFER_PRESENT return __queue.get_device().has(sycl::aspect::usm_device_allocations); #else return false; @@ -567,6 +567,7 @@ struct __result_and_scratch_storage } else if (__supports_USM_device) { + std::cout << "device" << std::endl; // If we don't use host memory, malloc only a single unified device allocation __scratch_buf = ::std::shared_ptr<_T>( __internal::__sycl_usm_alloc<_ExecutionPolicy, _T, sycl::usm::alloc::device>{__exec}(__scratch_n + 1), @@ -574,6 +575,7 @@ struct __result_and_scratch_storage } else { + std::cout << "buffer" << std::endl; // If we don't have USM support allocate memory here __sycl_buf = ::std::make_shared<__sycl_buffer_t>(__sycl_buffer_t(__scratch_n + 1)); } From 7f099ce22b6f282441a410469392a82580fbd583 Mon Sep 17 00:00:00 2001 From: Matthew Michel Date: Mon, 15 Apr 2024 17:55:01 -0500 Subject: [PATCH 2/2] Remove debugging print statements Signed-off-by: Matthew Michel --- .../oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_utils.h | 2 -- 1 file changed, 2 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 473332d9534..c3aaabf1753 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 @@ -567,7 +567,6 @@ struct __result_and_scratch_storage } else if (__supports_USM_device) { - std::cout << "device" << std::endl; // If we don't use host memory, malloc only a single unified device allocation __scratch_buf = ::std::shared_ptr<_T>( __internal::__sycl_usm_alloc<_ExecutionPolicy, _T, sycl::usm::alloc::device>{__exec}(__scratch_n + 1), @@ -575,7 +574,6 @@ struct __result_and_scratch_storage } else { - std::cout << "buffer" << std::endl; // If we don't have USM support allocate memory here __sycl_buf = ::std::make_shared<__sycl_buffer_t>(__sycl_buffer_t(__scratch_n + 1)); }