From 2f334ff263e7c2c48ea332f3bf670163991df7dd Mon Sep 17 00:00:00 2001 From: Matthew Michel Date: Fri, 10 Jan 2025 12:02:57 -0800 Subject: [PATCH] Make __kernels static so vector alloc / free occurs once on first call Signed-off-by: Matthew Michel --- .../hetero/dpcpp/parallel_backend_sycl_reduce_then_scan.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_reduce_then_scan.h b/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_reduce_then_scan.h index b52f3b0c0f..beb0f6837a 100644 --- a/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_reduce_then_scan.h +++ b/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_reduce_then_scan.h @@ -765,9 +765,9 @@ __parallel_transform_reduce_then_scan(oneapi::dpl::__internal::__device_backend_ using _ScanKernel = oneapi::dpl::__par_backend_hetero::__internal::__kernel_name_generator< __reduce_then_scan_scan_kernel, _CustomName, _InRng, _OutRng, _GenScanInput, _ScanInputTransform, _WriteOp, _InitType, _Inclusive, _IsUniquePattern>; - auto __kernels = __internal::__kernel_compiler<_ReduceKernel, _ScanKernel>::__compile(__exec); - sycl::kernel& __reduce_kernel = __kernels[0]; - sycl::kernel& __scan_kernel = __kernels[1]; + static auto __kernels = __internal::__kernel_compiler<_ReduceKernel, _ScanKernel>::__compile(__exec); + sycl::kernel __reduce_kernel = __kernels[0]; + sycl::kernel __scan_kernel = __kernels[1]; constexpr std::uint8_t __sub_group_size = 32; constexpr std::uint8_t __block_size_scale = std::max(std::size_t{1}, sizeof(double) / sizeof(_ValueType));