From 75c384fa644295e07f24e51fc7f7c257c9ec9223 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Mon, 24 Jun 2024 11:08:17 -0400 Subject: [PATCH 01/11] improve requirements for iterator source types Signed-off-by: Dan Hoeflinger --- .../elements/oneDPL/source/parallel_api.rst | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index 77d0c192b..70e9ba466 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -92,6 +92,19 @@ Iterators The oneDPL iterators are defined in the ```` header, in ``namespace oneapi::dpl``. +Let us define a named requirement, :code:`ValidParallelIteratorSource`, to describe valid random access iterator-like +types that can be used as source for oneDPL's iterators as described below. +The type :code:`Iter` satisfies the :code:`ValidParallelIteratorSource` named requirement if it satisfies +at least one of the following: + * :code:`Iter` satisfies the C++ named requirement :code:`LegacyRandomAccessIterator` + * :code:`Iter` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` + * :code:`Iter` is a valid :code:`permutation_iterator` + * :code:`Iter` is a valid :code:`transform_iterator` + * :code:`Iter` is a valid :code:`counting_iterator` + * :code:`Iter` is a valid :code:`discard_iterator` + * :code:`Iter` is a valid :code:`zip_iterator` + * :code:`Iter` is a valid :code:`std::reverse_iterator` where :code:`It` satisfies :code:`ValidParallelIteratorSource` + .. code:: cpp template @@ -221,7 +234,19 @@ defined by the source iterator provided, and whose iteration order over the dere is defined by either another iterator or a functor that maps the ``permutation_iterator`` index to the index of the source iterator. The arithmetic and comparison operators of ``permutation_iterator`` behave as if applied to integer counter values maintained by the -iterator instances to determine their position in the index map. +iterator instances to determine their position in the index map. :code:`SourceIterator` must satisfy +:code:`ValidParallelIteratorSource`. + +The :code:`IndexMap` must satisfy at least one of the following: + * :code:`IndexMap` satisfies the C++ named requirement :code:`LegacyRandomAccessIterator` + * :code:`IndexMap` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` + * :code:`IndexMap` is a valid :code:`permutation_iterator` + * :code:`IndexMap` is a valid :code:`transform_iterator` + * :code:`IndexMap` is a valid :code:`counting_iterator` + * :code:`IndexMap` is a valid :code:`std::reverse_iterator` where :code:`Iter` is a valid non-functor :code:`IndexMap` type + * :code:`IndexMap` is a functor with a signature equivalent to :code:`T operator()(const T&) const` where + :code:`T` is a `std::iterator_traits::difference_type` + ``permutation_iterator::operator*`` uses the counter value of the instance on which it is invoked to index into the index map. The corresponding value in the map is then used @@ -290,7 +315,8 @@ defined by the unary function and source iterator provided. When dereferenced, element of the source iterator; dereference operations cannot be used to modify the elements of the source iterator unless the unary function result includes a reference to the element. The arithmetic and comparison operators of ``transform_iterator`` behave as if applied to the -source iterator itself. +source iterator itself. The template type :code:`Iterator` must satisfy +:code:`ValidParallelIteratorSource`. .. code:: cpp @@ -346,9 +372,10 @@ using the source iterator and unary function object provided. ``zip_iterator`` is an iterator-like type defined over one or more iterators. When dereferenced, the value returned from ``zip_iterator`` is a tuple of the values returned by dereferencing the -source iterators over which the ``zip_iterator`` is defined. The arithmetic operators of +source iterators over which the ``zip_iterator`` is defined. The arithmetic operators of ``zip_iterator`` update the source iterators of a ``zip_iterator`` instance as though the -operation were applied to each of these iterators. +operation were applied to each of these iterators. The types :code:`T` within the template pack +:code:`Iterators...` must satisfy :code:`ValidParallelIteratorSource`. .. code:: cpp From 6e52f01151e9e3baf1832d549be83447ece015d5 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Wed, 26 Jun 2024 09:48:56 -0400 Subject: [PATCH 02/11] remove reverse_iter as it cannot be applied to unspecified iterator-like type (We would need to require that the reversed iterator satisfies legacy random access iterator, but we get that for free as reverse iterator does not modify that trait.) Signed-off-by: Dan Hoeflinger --- source/elements/oneDPL/source/parallel_api.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index 70e9ba466..ace468e5b 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -103,7 +103,6 @@ at least one of the following: * :code:`Iter` is a valid :code:`counting_iterator` * :code:`Iter` is a valid :code:`discard_iterator` * :code:`Iter` is a valid :code:`zip_iterator` - * :code:`Iter` is a valid :code:`std::reverse_iterator` where :code:`It` satisfies :code:`ValidParallelIteratorSource` .. code:: cpp @@ -243,7 +242,6 @@ The :code:`IndexMap` must satisfy at least one of the following: * :code:`IndexMap` is a valid :code:`permutation_iterator` * :code:`IndexMap` is a valid :code:`transform_iterator` * :code:`IndexMap` is a valid :code:`counting_iterator` - * :code:`IndexMap` is a valid :code:`std::reverse_iterator` where :code:`Iter` is a valid non-functor :code:`IndexMap` type * :code:`IndexMap` is a functor with a signature equivalent to :code:`T operator()(const T&) const` where :code:`T` is a `std::iterator_traits::difference_type` From 631739d7968e1f52944c068947b29c61fa2aa9be Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Wed, 26 Jun 2024 09:54:45 -0400 Subject: [PATCH 03/11] adding missing word Signed-off-by: Dan Hoeflinger --- source/elements/oneDPL/source/parallel_api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index ace468e5b..15d3fee05 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -236,7 +236,7 @@ to the index of the source iterator. The arithmetic and comparison operators of iterator instances to determine their position in the index map. :code:`SourceIterator` must satisfy :code:`ValidParallelIteratorSource`. -The :code:`IndexMap` must satisfy at least one of the following: +The type :code:`IndexMap` must satisfy at least one of the following: * :code:`IndexMap` satisfies the C++ named requirement :code:`LegacyRandomAccessIterator` * :code:`IndexMap` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` * :code:`IndexMap` is a valid :code:`permutation_iterator` From 7793de44a098b40426dad85a0cc425702cd7ac9a Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Fri, 16 Aug 2024 08:59:42 -0400 Subject: [PATCH 04/11] LegacyRandomAccessIterator -> random access iterator Signed-off-by: Dan Hoeflinger --- source/elements/oneDPL/source/parallel_api.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index 15d3fee05..29ee67bcb 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -96,7 +96,7 @@ Let us define a named requirement, :code:`ValidParallelIteratorSource`, to descr types that can be used as source for oneDPL's iterators as described below. The type :code:`Iter` satisfies the :code:`ValidParallelIteratorSource` named requirement if it satisfies at least one of the following: - * :code:`Iter` satisfies the C++ named requirement :code:`LegacyRandomAccessIterator` + * :code:`Iter` is a random access iterator * :code:`Iter` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` * :code:`Iter` is a valid :code:`permutation_iterator` * :code:`Iter` is a valid :code:`transform_iterator` @@ -237,7 +237,7 @@ iterator instances to determine their position in the index map. :code:`SourceIt :code:`ValidParallelIteratorSource`. The type :code:`IndexMap` must satisfy at least one of the following: - * :code:`IndexMap` satisfies the C++ named requirement :code:`LegacyRandomAccessIterator` + * :code:`IndexMap` is a random access iterator * :code:`IndexMap` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` * :code:`IndexMap` is a valid :code:`permutation_iterator` * :code:`IndexMap` is a valid :code:`transform_iterator` From ae32414f78af278a46b78efe24acd67f4c4eb290 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Fri, 16 Aug 2024 09:10:39 -0400 Subject: [PATCH 05/11] formatting fix Signed-off-by: Dan Hoeflinger --- .../elements/oneDPL/source/parallel_api.rst | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index 29ee67bcb..a0a4ee1e4 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -96,13 +96,13 @@ Let us define a named requirement, :code:`ValidParallelIteratorSource`, to descr types that can be used as source for oneDPL's iterators as described below. The type :code:`Iter` satisfies the :code:`ValidParallelIteratorSource` named requirement if it satisfies at least one of the following: - * :code:`Iter` is a random access iterator - * :code:`Iter` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` - * :code:`Iter` is a valid :code:`permutation_iterator` - * :code:`Iter` is a valid :code:`transform_iterator` - * :code:`Iter` is a valid :code:`counting_iterator` - * :code:`Iter` is a valid :code:`discard_iterator` - * :code:`Iter` is a valid :code:`zip_iterator` +* :code:`Iter` is a random access iterator +* :code:`Iter` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` +* :code:`Iter` is a valid :code:`permutation_iterator` +* :code:`Iter` is a valid :code:`transform_iterator` +* :code:`Iter` is a valid :code:`counting_iterator` +* :code:`Iter` is a valid :code:`discard_iterator` +* :code:`Iter` is a valid :code:`zip_iterator` .. code:: cpp @@ -237,13 +237,13 @@ iterator instances to determine their position in the index map. :code:`SourceIt :code:`ValidParallelIteratorSource`. The type :code:`IndexMap` must satisfy at least one of the following: - * :code:`IndexMap` is a random access iterator - * :code:`IndexMap` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` - * :code:`IndexMap` is a valid :code:`permutation_iterator` - * :code:`IndexMap` is a valid :code:`transform_iterator` - * :code:`IndexMap` is a valid :code:`counting_iterator` - * :code:`IndexMap` is a functor with a signature equivalent to :code:`T operator()(const T&) const` where - :code:`T` is a `std::iterator_traits::difference_type` +* :code:`IndexMap` is a random access iterator +* :code:`IndexMap` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` +* :code:`IndexMap` is a valid :code:`permutation_iterator` +* :code:`IndexMap` is a valid :code:`transform_iterator` +* :code:`IndexMap` is a valid :code:`counting_iterator` +* :code:`IndexMap` is a functor with a signature equivalent to :code:`T operator()(const T&) const` where + :code:`T` is a `std::iterator_traits::difference_type` ``permutation_iterator::operator*`` uses the counter value of the instance on which From 59db0ab860d30950b914edaa42cb4f0f3931860e Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Fri, 16 Aug 2024 09:14:04 -0400 Subject: [PATCH 06/11] formatting fix (attempt 2) Signed-off-by: Dan Hoeflinger --- .../elements/oneDPL/source/parallel_api.rst | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index a0a4ee1e4..a3cfc4aa4 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -96,13 +96,14 @@ Let us define a named requirement, :code:`ValidParallelIteratorSource`, to descr types that can be used as source for oneDPL's iterators as described below. The type :code:`Iter` satisfies the :code:`ValidParallelIteratorSource` named requirement if it satisfies at least one of the following: -* :code:`Iter` is a random access iterator -* :code:`Iter` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` -* :code:`Iter` is a valid :code:`permutation_iterator` -* :code:`Iter` is a valid :code:`transform_iterator` -* :code:`Iter` is a valid :code:`counting_iterator` -* :code:`Iter` is a valid :code:`discard_iterator` -* :code:`Iter` is a valid :code:`zip_iterator` + + * :code:`Iter` is a random access iterator + * :code:`Iter` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` + * :code:`Iter` is a valid :code:`permutation_iterator` + * :code:`Iter` is a valid :code:`transform_iterator` + * :code:`Iter` is a valid :code:`counting_iterator` + * :code:`Iter` is a valid :code:`discard_iterator` + * :code:`Iter` is a valid :code:`zip_iterator` .. code:: cpp @@ -237,13 +238,14 @@ iterator instances to determine their position in the index map. :code:`SourceIt :code:`ValidParallelIteratorSource`. The type :code:`IndexMap` must satisfy at least one of the following: -* :code:`IndexMap` is a random access iterator -* :code:`IndexMap` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` -* :code:`IndexMap` is a valid :code:`permutation_iterator` -* :code:`IndexMap` is a valid :code:`transform_iterator` -* :code:`IndexMap` is a valid :code:`counting_iterator` -* :code:`IndexMap` is a functor with a signature equivalent to :code:`T operator()(const T&) const` where - :code:`T` is a `std::iterator_traits::difference_type` + + * :code:`IndexMap` is a random access iterator + * :code:`IndexMap` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` + * :code:`IndexMap` is a valid :code:`permutation_iterator` + * :code:`IndexMap` is a valid :code:`transform_iterator` + * :code:`IndexMap` is a valid :code:`counting_iterator` + * :code:`IndexMap` is a functor with a signature equivalent to :code:`T operator()(const T&) const` where + :code:`T` is a `std::iterator_traits::difference_type` ``permutation_iterator::operator*`` uses the counter value of the instance on which From 14c9bb69295ca46c30ca27fd0b070bd85a6c0468 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Fri, 16 Aug 2024 11:11:45 -0400 Subject: [PATCH 07/11] Improving language (removing valid) Signed-off-by: Dan Hoeflinger --- .../elements/oneDPL/source/parallel_api.rst | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index a3cfc4aa4..1287cafbd 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -92,18 +92,17 @@ Iterators The oneDPL iterators are defined in the ```` header, in ``namespace oneapi::dpl``. -Let us define a named requirement, :code:`ValidParallelIteratorSource`, to describe valid random access iterator-like -types that can be used as source for oneDPL's iterators as described below. -The type :code:`Iter` satisfies the :code:`ValidParallelIteratorSource` named requirement if it satisfies -at least one of the following: - - * :code:`Iter` is a random access iterator - * :code:`Iter` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` - * :code:`Iter` is a valid :code:`permutation_iterator` - * :code:`Iter` is a valid :code:`transform_iterator` - * :code:`Iter` is a valid :code:`counting_iterator` - * :code:`Iter` is a valid :code:`discard_iterator` - * :code:`Iter` is a valid :code:`zip_iterator` +Let us define a named requirement, :code:`AdaptingIteratorSource`, to describe valid random access iterator-like +types that can be used as source for oneDPL iterators as described below. +The type :code:`Iter` satisfies the :code:`AdaptingIteratorSource` named requirement if is any of the following: + + * a random access iterator + * the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` + * a :code:`permutation_iterator` + * a :code:`transform_iterator` + * a :code:`counting_iterator` + * a :code:`discard_iterator` + * a :code:`zip_iterator` .. code:: cpp @@ -235,17 +234,17 @@ is defined by either another iterator or a functor that maps the ``permutation_i to the index of the source iterator. The arithmetic and comparison operators of ``permutation_iterator`` behave as if applied to integer counter values maintained by the iterator instances to determine their position in the index map. :code:`SourceIterator` must satisfy -:code:`ValidParallelIteratorSource`. +:code:`AdaptingIteratorSource`. -The type :code:`IndexMap` must satisfy at least one of the following: +The type :code:`IndexMap` must be one of the following: - * :code:`IndexMap` is a random access iterator - * :code:`IndexMap` is the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` - * :code:`IndexMap` is a valid :code:`permutation_iterator` - * :code:`IndexMap` is a valid :code:`transform_iterator` - * :code:`IndexMap` is a valid :code:`counting_iterator` - * :code:`IndexMap` is a functor with a signature equivalent to :code:`T operator()(const T&) const` where - :code:`T` is a `std::iterator_traits::difference_type` + * a random access iterator + * the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` + * a :code:`permutation_iterator` + * a :code:`transform_iterator` + * a :code:`counting_iterator` + * a functor with a signature equivalent to :code:`T operator()(const T&) const` where :code:`T` is a + :code:`std::iterator_traits::difference_type` ``permutation_iterator::operator*`` uses the counter value of the instance on which @@ -316,7 +315,7 @@ element of the source iterator; dereference operations cannot be used to modify the source iterator unless the unary function result includes a reference to the element. The arithmetic and comparison operators of ``transform_iterator`` behave as if applied to the source iterator itself. The template type :code:`Iterator` must satisfy -:code:`ValidParallelIteratorSource`. +:code:`AdaptingIteratorSource`. .. code:: cpp @@ -375,7 +374,7 @@ the value returned from ``zip_iterator`` is a tuple of the values returned by de source iterators over which the ``zip_iterator`` is defined. The arithmetic operators of ``zip_iterator`` update the source iterators of a ``zip_iterator`` instance as though the operation were applied to each of these iterators. The types :code:`T` within the template pack -:code:`Iterators...` must satisfy :code:`ValidParallelIteratorSource`. +:code:`Iterators...` must satisfy :code:`AdaptingIteratorSource`. .. code:: cpp From d0fb48532f86b70c8bb6de52bb1c4c1c5890fdd0 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger <109972525+danhoeflinger@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:40:15 -0400 Subject: [PATCH 08/11] applying suggestion (typo) Co-authored-by: Alexey Kukanov --- source/elements/oneDPL/source/parallel_api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index 1287cafbd..1e660da0a 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -94,7 +94,7 @@ in ``namespace oneapi::dpl``. Let us define a named requirement, :code:`AdaptingIteratorSource`, to describe valid random access iterator-like types that can be used as source for oneDPL iterators as described below. -The type :code:`Iter` satisfies the :code:`AdaptingIteratorSource` named requirement if is any of the following: +The type :code:`Iter` satisfies the :code:`AdaptingIteratorSource` named requirement if it is any of the following: * a random access iterator * the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` From 5289defbb547733b140a3e2a4d50a7b22c9cc666 Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Fri, 16 Aug 2024 13:31:40 -0400 Subject: [PATCH 09/11] capitalizing bulleted entries Signed-off-by: Dan Hoeflinger --- .../elements/oneDPL/source/parallel_api.rst | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index 1e660da0a..0f4b8188a 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -96,13 +96,13 @@ Let us define a named requirement, :code:`AdaptingIteratorSource`, to describe v types that can be used as source for oneDPL iterators as described below. The type :code:`Iter` satisfies the :code:`AdaptingIteratorSource` named requirement if it is any of the following: - * a random access iterator - * the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` - * a :code:`permutation_iterator` - * a :code:`transform_iterator` - * a :code:`counting_iterator` - * a :code:`discard_iterator` - * a :code:`zip_iterator` + * A random access iterator + * The unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` + * A :code:`permutation_iterator` + * A :code:`transform_iterator` + * A :code:`counting_iterator` + * A :code:`discard_iterator` + * A :code:`zip_iterator` .. code:: cpp @@ -238,12 +238,12 @@ iterator instances to determine their position in the index map. :code:`SourceIt The type :code:`IndexMap` must be one of the following: - * a random access iterator - * the unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` - * a :code:`permutation_iterator` - * a :code:`transform_iterator` - * a :code:`counting_iterator` - * a functor with a signature equivalent to :code:`T operator()(const T&) const` where :code:`T` is a + * A random access iterator + * The unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` + * A :code:`permutation_iterator` + * A :code:`transform_iterator` + * A :code:`counting_iterator` + * A functor with a signature equivalent to :code:`T operator()(const T&) const` where :code:`T` is a :code:`std::iterator_traits::difference_type` From d00d244b8678b9de6befaabb0cb11dbf5861355a Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Tue, 20 Aug 2024 14:21:12 -0400 Subject: [PATCH 10/11] conforming to conventions for :code:`foo` vs ``foo`` Signed-off-by: Dan Hoeflinger --- .../elements/oneDPL/source/parallel_api.rst | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index 0f4b8188a..e366ce35c 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -92,17 +92,17 @@ Iterators The oneDPL iterators are defined in the ```` header, in ``namespace oneapi::dpl``. -Let us define a named requirement, :code:`AdaptingIteratorSource`, to describe valid random access iterator-like +Let us define a named requirement, ``AdaptingIteratorSource``, to describe valid random access iterator-like types that can be used as source for oneDPL iterators as described below. -The type :code:`Iter` satisfies the :code:`AdaptingIteratorSource` named requirement if it is any of the following: +The type ``Iter`` satisfies the ``AdaptingIteratorSource`` named requirement if it is any of the following: * A random access iterator - * The unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` - * A :code:`permutation_iterator` - * A :code:`transform_iterator` - * A :code:`counting_iterator` - * A :code:`discard_iterator` - * A :code:`zip_iterator` + * The unspecified iterator-like type returned by ``oneapi::dpl::begin`` or ``oneapi::dpl::end`` + * A ``permutation_iterator`` + * A ``transform_iterator`` + * A ``counting_iterator`` + * A ``discard_iterator`` + * A ``zip_iterator`` .. code:: cpp @@ -233,18 +233,18 @@ defined by the source iterator provided, and whose iteration order over the dere is defined by either another iterator or a functor that maps the ``permutation_iterator`` index to the index of the source iterator. The arithmetic and comparison operators of ``permutation_iterator`` behave as if applied to integer counter values maintained by the -iterator instances to determine their position in the index map. :code:`SourceIterator` must satisfy -:code:`AdaptingIteratorSource`. +iterator instances to determine their position in the index map. ``SourceIterator`` must satisfy +``AdaptingIteratorSource``. -The type :code:`IndexMap` must be one of the following: +The type ``IndexMap`` must be one of the following: * A random access iterator - * The unspecified iterator-like type returned by :code:`oneapi::dpl::begin` or :code:`oneapi::dpl::end` - * A :code:`permutation_iterator` - * A :code:`transform_iterator` - * A :code:`counting_iterator` - * A functor with a signature equivalent to :code:`T operator()(const T&) const` where :code:`T` is a - :code:`std::iterator_traits::difference_type` + * The unspecified iterator-like type returned by ``oneapi::dpl::begin`` or ``oneapi::dpl::end`` + * A ``permutation_iterator`` + * A ``transform_iterator`` + * A ``counting_iterator`` + * A functor with a signature equivalent to ``T operator()(const T&) const`` where ``T`` is a + ``std::iterator_traits::difference_type`` ``permutation_iterator::operator*`` uses the counter value of the instance on which @@ -314,8 +314,8 @@ defined by the unary function and source iterator provided. When dereferenced, element of the source iterator; dereference operations cannot be used to modify the elements of the source iterator unless the unary function result includes a reference to the element. The arithmetic and comparison operators of ``transform_iterator`` behave as if applied to the -source iterator itself. The template type :code:`Iterator` must satisfy -:code:`AdaptingIteratorSource`. +source iterator itself. The template type ``Iterator`` must satisfy +``AdaptingIteratorSource``. .. code:: cpp @@ -373,8 +373,8 @@ using the source iterator and unary function object provided. the value returned from ``zip_iterator`` is a tuple of the values returned by dereferencing the source iterators over which the ``zip_iterator`` is defined. The arithmetic operators of ``zip_iterator`` update the source iterators of a ``zip_iterator`` instance as though the -operation were applied to each of these iterators. The types :code:`T` within the template pack -:code:`Iterators...` must satisfy :code:`AdaptingIteratorSource`. +operation were applied to each of these iterators. The types ``T`` within the template pack +``Iterators...`` must satisfy ``AdaptingIteratorSource``. .. code:: cpp From 3d25f88f23fa3a4e54e21ec241ad1c439003a2bc Mon Sep 17 00:00:00 2001 From: Dan Hoeflinger Date: Tue, 20 Aug 2024 14:22:52 -0400 Subject: [PATCH 11/11] removing extra space Signed-off-by: Dan Hoeflinger --- source/elements/oneDPL/source/parallel_api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/elements/oneDPL/source/parallel_api.rst b/source/elements/oneDPL/source/parallel_api.rst index e366ce35c..95a76483c 100644 --- a/source/elements/oneDPL/source/parallel_api.rst +++ b/source/elements/oneDPL/source/parallel_api.rst @@ -371,7 +371,7 @@ using the source iterator and unary function object provided. ``zip_iterator`` is an iterator-like type defined over one or more iterators. When dereferenced, the value returned from ``zip_iterator`` is a tuple of the values returned by dereferencing the -source iterators over which the ``zip_iterator`` is defined. The arithmetic operators of +source iterators over which the ``zip_iterator`` is defined. The arithmetic operators of ``zip_iterator`` update the source iterators of a ``zip_iterator`` instance as though the operation were applied to each of these iterators. The types ``T`` within the template pack ``Iterators...`` must satisfy ``AdaptingIteratorSource``.