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 74606208870..e73c5ee5690 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 @@ -311,10 +311,9 @@ struct __parallel_merge_submitter_large<_IdType, _CustomName, // Pessimistically only use 2/3 of the memory to take into account memory used by compiled kernel const auto __slm_adjusted_work_group_size = oneapi::dpl::__internal::__slm_adjusted_work_group_size(__exec, sizeof(_RangeValueType)); const auto __slm_adjusted_work_group_size_x_part = __slm_adjusted_work_group_size * 4 / 5; - const std::size_t __max_slm_size_adj = __slm_adjusted_work_group_size_x_part; // The amount of data must be a multiple of the chunk size. - const std::size_t __max_source_data_items_fit_into_slm = __max_slm_size_adj - __max_slm_size_adj % __chunk; + const std::size_t __max_source_data_items_fit_into_slm = __slm_adjusted_work_group_size_x_part - __slm_adjusted_work_group_size_x_part % __chunk; assert(__max_source_data_items_fit_into_slm > 0); assert(__max_source_data_items_fit_into_slm % __chunk == 0);