From 7906635803befb86d234cac2da5a8e5b68027e76 Mon Sep 17 00:00:00 2001 From: Sergey Kopienko Date: Sun, 22 Dec 2024 22:26:26 +0100 Subject: [PATCH] include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge_sort.h - fix an error in tests Signed-off-by: Sergey Kopienko --- .../pstl/hetero/dpcpp/parallel_backend_sycl_merge_sort.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge_sort.h b/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge_sort.h index 2ea8cba95a8..7a2c6e4fbe0 100644 --- a/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge_sort.h +++ b/include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge_sort.h @@ -340,6 +340,12 @@ struct __merge_sort_global_submitter<_IndexT, __internal::__optional_kernel_name // TODO required to evaluate this value based on available SLM size for each work-group. _IndexT __base_diag_count = 32 * 1'024; // 32 Kb + + // TODO required to rewrite this without loop + while (__n_sorted <= __base_diag_count) + __n_sorted = __n_sorted * 2; + __base_diag_count = __n_sorted / 2; + _IndexT __steps_between_two_base_diags = oneapi::dpl::__internal::__dpl_ceiling_div(__steps, __base_diag_count); return {__base_diag_count, __steps_between_two_base_diags, __chunk, __steps};