From 1b5c99e199e2e32210b0c3ff3c48b9c073db098f Mon Sep 17 00:00:00 2001 From: Alexey Kukanov Date: Fri, 23 Aug 2024 16:19:13 +0200 Subject: [PATCH] Add whole sequence operations --- .../parallel_api/parallel_range_api.rst | 54 +++++++++++++++++++ 1 file changed, 54 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 2675a282c..48f5c53b8 100644 --- a/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst +++ b/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst @@ -23,5 +23,59 @@ The following differences to the standard C++ range algorithms apply: - For a given algorithm, at least one of the input ranges as well as the output range must be bounded. - ``for_each`` does not return its function object. +Whole Sequence Operations ++++++++++++++++++++++++++ + +.. code:: cpp + + // Defined in + + namespace oneapi::dpl::ranges { + + // all_of + template , Proj > > Pred> + requires oneapi::dpl::is_execution_policy_v> + && std::ranges::sized_range + bool all_of(ExecutionPolicy&& pol, R&& r, Pred pred, Proj proj = {}); + + // any_of + template , Proj > > Pred> + requires oneapi::dpl::is_execution_policy_v> + && std::ranges::sized_range + bool any_of(ExecutionPolicy&& pol, R&& r, Pred pred, Proj proj = {}); + + // none_of + template , Proj > > Pred> + requires oneapi::dpl::is_execution_policy_v> + && std::ranges::sized_range + bool none_of(ExecutionPolicy&& pol, R&& r, Pred pred, Proj proj = {}); + + // for_each + template , Proj > > Fun> + requires oneapi::dpl::is_execution_policy_v> + && std::ranges::sized_range + borrowed_iterator_t for_each(ExecutionPolicy&& pol, R&& r, Fun f, Proj proj = {}); + + // count + template , Proj>> + requires oneapi::dpl::is_execution_policy_v> + && std::ranges::sized_range + && indirect_binary_predicate, Proj >, const T*> + range_difference_t count(ExecutionPolicy&& pol, R&& r, const T& value, Proj proj = {}); + + // count_if + template , Proj > > Pred> + requires oneapi::dpl::is_execution_policy_v> + && std::ranges::sized_range + range_difference_t count_if(ExecutionPolicy&& pol, R&& r, Pred pred, Proj proj = {}); + + } + .. _`C++ Standard`: https://isocpp.org/std/the-standard .. _`SYCL`: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html