From 8324b6109feec8b4565ad3909c69276002a4a354 Mon Sep 17 00:00:00 2001 From: Dmitriy Sobolev Date: Mon, 22 Sep 2025 11:15:58 +0100 Subject: [PATCH 1/2] Add shift_left and shift_right --- .../source/parallel_api/parallel_range_api.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst b/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst index 20251dcad..31d92c145 100644 --- a/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst +++ b/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst @@ -653,6 +653,20 @@ In-place Mutating Operations std::ranges::borrowed_subrange_t remove_if (ExecutionPolicy&& pol, R&& r, Pred pred, Proj proj = {}); + // shift_left + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && std::permutable> + std::ranges::borrowed_subrange_t + shift_left (ExecutionPolicy&& pol, R&& r, std::ranges::range_difference_t n); + + // shift_right + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && std::permutable> + std::ranges::borrowed_subrange_t + shift_right (ExecutionPolicy&& pol, R&& r, std::ranges::range_difference_t n); + // reverse template requires oneapi::dpl::is_execution_policy_v> && From c693df6166b76486a5298ffd49b4e99a7cb16ed1 Mon Sep 17 00:00:00 2001 From: Dmitriy Sobolev Date: Fri, 24 Oct 2025 19:12:43 +0100 Subject: [PATCH 2/2] Create Sequence Reordering group, move rotate and rotate_copy there --- .../parallel_api/parallel_range_api.rst | 61 ++++++++++++++----- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst b/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst index 79848a20a..5b48aad2a 100644 --- a/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst +++ b/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst @@ -34,8 +34,8 @@ The following differences to the standard serial C++ range algorithms apply: In that case, the returned value contains iterators pointing to the positions past the last elements processed according to the algorithm semantics. - ``for_each`` does not return its function object. -- The return type of ``reverse_copy`` is ``std::ranges::in_in_out_result`` - rather than ``std::ranges::reverse_copy_result``. +- The return type of ``reverse_copy`` and ``rotate_copy`` is ``std::ranges::in_in_out_result`` + rather than ``std::ranges::reverse_copy_result`` and ``std::ranges::rotate_copy_result``, respectively. The semantics of the returned value are as specified in `P3709R2 `_. - ``destroy`` is not marked with ``noexcept``. @@ -718,20 +718,6 @@ In-place Mutating Operations std::ranges::borrowed_subrange_t remove_if (ExecutionPolicy&& pol, R&& r, Pred pred, Proj proj = {}); - // shift_left - template - requires oneapi::dpl::is_execution_policy_v> && - std::ranges::sized_range && std::permutable> - std::ranges::borrowed_subrange_t - shift_left (ExecutionPolicy&& pol, R&& r, std::ranges::range_difference_t n); - - // shift_right - template - requires oneapi::dpl::is_execution_policy_v> && - std::ranges::sized_range && std::permutable> - std::ranges::borrowed_subrange_t - shift_right (ExecutionPolicy&& pol, R&& r, std::ranges::range_difference_t n); - // reverse template requires oneapi::dpl::is_execution_policy_v> && @@ -761,6 +747,49 @@ In-place Mutating Operations } +Sequence Reordering ++++++++++++++++++++ + +.. code:: cpp + + // Defined in + + namespace oneapi::dpl::ranges { + + // shift_left + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && std::permutable> + std::ranges::borrowed_subrange_t + shift_left (ExecutionPolicy&& pol, R&& r, std::ranges::range_difference_t n); + + // shift_right + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && std::permutable> + std::ranges::borrowed_subrange_t + shift_right (ExecutionPolicy&& pol, R&& r, std::ranges::range_difference_t n); + + // rotate + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && std::permutable> + std::ranges::borrowed_subrange_t + rotate (ExecutionPolicy&& pol, R&& r, std::ranges::iterator_t middle); + + // rotate_copy + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && std::ranges::sized_range && + std::indirectly_copyable, std::ranges::iterator_t> + std::ranges::in_in_out_result, + std::ranges::borrowed_iterator_t, + std::ranges::borrowed_iterator_t> + rotate_copy (ExecutionPolicy&& pol, R&& r, std::ranges::iterator_t middle, OutR&& result); + + } + Uninitialized Memory Algorithms +++++++++++++++++++++++++++++++