From 7072c91ea1a6da5edced1ae9bbeae2edcc753235 Mon Sep 17 00:00:00 2001 From: Dmitriy Sobolev Date: Mon, 22 Sep 2025 12:43:31 +0100 Subject: [PATCH] Add partition algorithms --- .../parallel_api/parallel_range_api.rst | 52 +++++++++++++++++++ 1 file changed, 52 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..ffcceb208 100644 --- a/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst +++ b/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst @@ -495,6 +495,58 @@ Set operations Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); } +Partition operations +++++++++++++++++++++ +.. code:: cpp + + // Defined in + + namespace oneapi::dpl::ranges { + + // is_partitioned + template , Proj> > Pred> + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range + bool is_partitioned (ExecutionPolicy&& pol, R&& r, Pred pred, Proj proj = {}); + + // partition + template , Proj> > Pred> + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && + std::permutable> + std::ranges::borrowed_subrange_t + partition (ExecutionPolicy&& pol, R&& r, Pred pred, Proj proj = {}); + + // stable_partition + template , Proj> > Pred> + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && std::permutable> + std::ranges::borrowed_subrange_t + stable_partition (ExecutionPolicy&& pol, R&& r, Pred pred, Proj proj = {}); + + // partition_copy + template , Proj> > Pred> + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && std::ranges::sized_range && + std::ranges::sized_range && + std::indirectly_copyable, std::ranges::iterator_t> && + std::indirectly_copyable, std::ranges::iterator_t> + std::ranges::partition_copy_result, + std::ranges::borrowed_iterator_t, + std::ranges::borrowed_iterator_t> + partition_copy (ExecutionPolicy&& pol, R&& r, OutR1&& out_true_r, OutR2&& out_false_r, + Pred pred, Proj proj = {}); + } + Copying Mutating Operations +++++++++++++++++++++++++++