From ed32a0f15991450a5010a0950f6bdecb5b64ec60 Mon Sep 17 00:00:00 2001 From: Sergey Kopienko Date: Thu, 19 Dec 2024 11:56:52 +0100 Subject: [PATCH] include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h - small refactoring of __parallel_merge_submitter_large::operator() Signed-off-by: Sergey Kopienko --- .../dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h b/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h index 3efe8888bf1..e202d727605 100644 --- a/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h +++ b/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h @@ -393,13 +393,13 @@ struct __parallel_merge_submitter_large<_IdType, _CustomName, // Calculate nd-range params const nd_range_params __nd_range_params = eval_nd_range_params(__exec, __rng1, __rng2); - __result_and_scratch_storage_base_ptr __p_result_and_scratch_storage_base; - // Create storage for save split-points on each base diagonal + 1 (for the right base diagonal in the last work-group) auto __p_base_diagonals_sp_global_storage = new __result_and_scratch_storage<_ExecutionPolicy, _split_point_t<_IdType>>( __exec, 0, __nd_range_params.base_diag_count + 1); - __p_result_and_scratch_storage_base.reset( + + // Save raw-pointer into shared_ptr for return it in __future to exted life-time of the storage + __result_and_scratch_storage_base_ptr __p_result_and_scratch_storage_base( static_cast<__result_and_scratch_storage_base*>(__p_base_diagonals_sp_global_storage)); sycl::event __event = eval_split_points_for_groups(__exec, __rng1, __rng2, __comp, __nd_range_params,