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 d5a353e5d..64dbab259 100644 --- a/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst +++ b/source/elements/oneDPL/source/parallel_api/parallel_range_api.rst @@ -33,6 +33,7 @@ The following differences to the standard 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. +- ``destroy`` is not marked with ``noexcept``. Except for these differences, the signatures of parallel range algorithms correspond to the working draft of the next edition of the C++ standard (C++26). @@ -46,9 +47,31 @@ of parallel range algorithms. .. code:: cpp // C++20 analogue of std::projected_value_t; exposition only - template + template using /*projected-value-type*/ = std::remove_cvref_t&>>; + // C++20 analogue of nothrow-random-access-range proposed for C++26 in P3179R9; exposition only + template + concept nothrow-random-access-range = + std::ranges::random_access_range && + std::is_lvalue_reference_v>> && + std::same_as>>, + std::iter_value_t>>; + +Semantic Requirements +~~~~~~~~~~~~~~~~~~~~~ + +A type ``R`` models ``nothrow-random-access-range`` if no exceptions are thrown from: + +- increment, decrement, copy construction, move construction, copy assignment, move assignment, + comparisons or indirection through valid iterators of type ``std::ranges::iterator_t``; +- ``-`` operator, copy construction, move construction, copy assignment, move assignment, + or comparisons between valid values of type ``std::ranges::iterator_t``; +- ``-``, ``+``, ``-=``, ``+=``, ``[]`` operators on valid values of type + ``std::ranges::iterator_t`` and ``std::iter_difference_t>``; +- calls to ``std::ranges::begin()``, ``std::ranges::end()`` and ``std::ranges::size()`` + on an object of type ``R``. + Whole Sequence Operations +++++++++++++++++++++++++ @@ -526,5 +549,67 @@ In-place Mutating Operations } +Uninitialized Memory Algorithms ++++++++++++++++++++++++++++++++ + +.. code:: cpp + + // Defined in + + namespace oneapi::dpl::ranges { + + // uninitialized_default_construct + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && + std::default_initializable> + std::ranges::borrowed_iterator_t + uninitialized_default_construct (ExecutionPolicy&& pol, R&& r); + + // uninitialized_value_construct + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && + std::default_initializable> + std::ranges::borrowed_iterator_t + uninitialized_value_construct (ExecutionPolicy&& pol, R&& r, const std::ranges::range_value_t& value); + + // uninitialized_copy + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && std::ranges::sized_range && + std::constructible_from, std::ranges::range_reference_t> + std::ranges::uninitialized_copy_result, + std::ranges::borrowed_iterator_t> + uninitialized_copy (ExecutionPolicy&& pol, IR&& in_range, OR&& out_range); + + // uninitialized_move + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && std::ranges::sized_range && + std::constructible_from, std::ranges::range_rvalue_reference_t> + std::ranges::uninitialized_move_result, + std::ranges::borrowed_iterator_t> + uninitialized_move (ExecutionPolicy&& pol, IR&& in_range, OR&& out_range); + + // uninitialized_fill + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && + std::constructible_from, const T&> + std::ranges::borrowed_iterator_t + uninitialized_fill (ExecutionPolicy&& pol, R&& r, const T& value); + + // destroy + template + requires oneapi::dpl::is_execution_policy_v> && + std::ranges::sized_range && + std::destructible> + std::ranges::borrowed_iterator_t + destroy (ExecutionPolicy&& pol, R&& r); + } + .. _`C++ Standard`: https://isocpp.org/std/the-standard .. _`SYCL`: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html