Skip to content

Commit bfeb805

Browse files
akukanovdcbenito
andauthored
[oneDPL] Formatting modifications (#565)
Co-authored-by: Dylan Benito <[email protected]>
1 parent a56d34b commit bfeb805

File tree

4 files changed

+86
-85
lines changed

4 files changed

+86
-85
lines changed

source/elements/oneDPL/source/common.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
Namespaces
66
----------
77

8-
oneDPL uses :code:`namespace oneapi::dpl` and a shorter variant :code:`namespace dpl` for all
8+
oneDPL uses ``namespace oneapi::dpl`` and a shorter variant ``namespace dpl`` for all
99
functionality including parallel algorithms, oneDPL execution policies, etc.
1010
For the subset of the standard C++ library for kernels, the standard class
11-
and function names are also aliased in :code:`namespace oneapi::dpl`.
11+
and function names are also aliased in ``namespace oneapi::dpl``.
1212

1313
oneDPL uses nested namespaces for the functionality aligned with the C++ standard.
14-
The names of those namespaces are the same as in :code:`namespace std`. For example,
15-
oneDPL execution policies are provided in :code:`namespace oneapi::dpl::execution`.
14+
The names of those namespaces are the same as in ``namespace std``. For example,
15+
oneDPL execution policies are provided in ``namespace oneapi::dpl::execution``.

source/elements/oneDPL/source/parallel_api.rst

Lines changed: 67 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ a set of non-standard parallel algorithms.
1717

1818
parallel_api/execution_policies.rst
1919

20-
Buffer wrappers
20+
Buffer Wrappers
2121
+++++++++++++++
2222

2323
.. code:: cpp
@@ -89,8 +89,8 @@ for ``begin`` and ``end``. Otherwise, the behavior is undefined.
8989
Iterators
9090
+++++++++
9191

92-
The oneDPL iterators are defined in the :code:`<oneapi/dpl/iterator>` header,
93-
in :code:`namespace oneapi::dpl`.
92+
The oneDPL iterators are defined in the ``<oneapi/dpl/iterator>`` header,
93+
in ``namespace oneapi::dpl``.
9494

9595
.. code:: cpp
9696
@@ -129,10 +129,10 @@ in :code:`namespace oneapi::dpl`.
129129
bool operator>=(const counting_iterator& it) const;
130130
};
131131
132-
:code:`counting_iterator` is a random access iterator-like type that represents an integer counter.
133-
When dereferenced, :code:`counting_iterator` provides an Integral rvalue equal to the value of the
132+
``counting_iterator`` is a random access iterator-like type that represents an integer counter.
133+
When dereferenced, ``counting_iterator`` provides an Integral rvalue equal to the value of the
134134
counter; dereference operations cannot be used to modify the counter. The arithmetic and comparison
135-
operators of :code:`counting_iterator` behave as if applied to the values of Integral type
135+
operators of ``counting_iterator`` behave as if applied to the values of Integral type
136136
representing the counters of the iterator instances passed to the operators.
137137

138138
.. code:: cpp
@@ -169,10 +169,10 @@ representing the counters of the iterator instances passed to the operators.
169169
bool operator>(const discard_iterator& it) const;
170170
};
171171
172-
:code:`discard_iterator` is a random access iterator-like type that, when dereferenced, provides an
172+
``discard_iterator`` is a random access iterator-like type that, when dereferenced, provides an
173173
lvalue that may be assigned an arbitrary value. The assignment has no effect on the
174-
:code:`discard_iterator` instance; the write is discarded. The arithmetic and comparison operators
175-
of :code:`discard_iterator` behave as if applied to integer counter values maintained by the
174+
``discard_iterator`` instance; the write is discarded. The arithmetic and comparison operators
175+
of ``discard_iterator`` behave as if applied to integer counter values maintained by the
176176
iterator instances to determine their position relative to each other.
177177

178178
.. code:: cpp
@@ -216,19 +216,19 @@ iterator instances to determine their position relative to each other.
216216
bool operator>=(const permutation_iterator& it) const;
217217
};
218218
219-
:code:`permutation_iterator` is a random access iterator-like type whose dereferenced value set is
219+
``permutation_iterator`` is a random access iterator-like type whose dereferenced value set is
220220
defined by the source iterator provided, and whose iteration order over the dereferenced value set
221-
is defined by either another iterator or a functor that maps the :code:`permutation_iterator` index
221+
is defined by either another iterator or a functor that maps the ``permutation_iterator`` index
222222
to the index of the source iterator. The arithmetic and comparison operators of
223-
:code:`permutation_iterator` behave as if applied to integer counter values maintained by the
223+
``permutation_iterator`` behave as if applied to integer counter values maintained by the
224224
iterator instances to determine their position in the index map.
225225

226-
:code:`permutation_iterator::operator*` uses the counter value of the instance on which
226+
``permutation_iterator::operator*`` uses the counter value of the instance on which
227227
it is invoked to index into the index map. The corresponding value in the map is then used
228228
to index into the value set defined by the source iterator. The resulting lvalue is returned
229229
as the result of the operator.
230230

231-
:code:`permutation_iterator::operator[]` uses the parameter :code:`i`
231+
``permutation_iterator::operator[]`` uses the parameter ``i``
232232
to index into the index map. The corresponding value in the map is then used
233233
to index into the value set defined by the source iterator. The resulting lvalue is returned
234234
as the result of the operator.
@@ -239,7 +239,7 @@ as the result of the operator.
239239
permutation_iterator<SourceIterator, IndexMap>
240240
make_permutation_iterator(SourceIterator source, IndexMap map);
241241
242-
:code:`make_permutation_iterator` constructs and returns an instance of :code:`permutation_iterator`
242+
``make_permutation_iterator`` constructs and returns an instance of ``permutation_iterator``
243243
using the source iterator and index map provided.
244244

245245
.. code:: cpp
@@ -284,12 +284,12 @@ using the source iterator and index map provided.
284284
bool operator>=(const transform_iterator& it) const;
285285
};
286286
287-
:code:`transform_iterator` is a random access iterator-like type whose dereferenced value set is
287+
``transform_iterator`` is a random access iterator-like type whose dereferenced value set is
288288
defined by the unary function and source iterator provided. When dereferenced,
289-
:code:`transform_iterator` provides the result of the unary function applied to the corresponding
289+
``transform_iterator`` provides the result of the unary function applied to the corresponding
290290
element of the source iterator; dereference operations cannot be used to modify the elements of
291291
the source iterator unless the unary function result includes a reference to the element. The
292-
arithmetic and comparison operators of :code:`transform_iterator` behave as if applied to the
292+
arithmetic and comparison operators of ``transform_iterator`` behave as if applied to the
293293
source iterator itself.
294294

295295
.. code:: cpp
@@ -298,7 +298,7 @@ source iterator itself.
298298
transform_iterator<UnaryFunc, Iterator>
299299
make_transform_iterator(Iterator, UnaryFunc);
300300
301-
:code:`make_transform_iterator` constructs and returns an instance of :code:`transform_iterator`
301+
``make_transform_iterator`` constructs and returns an instance of ``transform_iterator``
302302
using the source iterator and unary function object provided.
303303

304304
.. code:: cpp
@@ -344,10 +344,10 @@ using the source iterator and unary function object provided.
344344
bool operator>=(const zip_iterator& it) const;
345345
};
346346
347-
:code:`zip_iterator` is an iterator-like type defined over one or more iterators. When dereferenced,
348-
the value returned from :code:`zip_iterator` is a tuple of the values returned by dereferencing the
349-
source iterators over which the :code:`zip_iterator` is defined. The arithmetic operators of
350-
:code:`zip_iterator` update the source iterators of a :code:`zip_iterator` instance as though the
347+
``zip_iterator`` is an iterator-like type defined over one or more iterators. When dereferenced,
348+
the value returned from ``zip_iterator`` is a tuple of the values returned by dereferencing the
349+
source iterators over which the ``zip_iterator`` is defined. The arithmetic operators of
350+
``zip_iterator`` update the source iterators of a ``zip_iterator`` instance as though the
351351
operation were applied to each of these iterators.
352352

353353
.. code:: cpp
@@ -356,14 +356,14 @@ operation were applied to each of these iterators.
356356
zip_iterator<Iterators...>
357357
make_zip_iterator(Iterators...);
358358
359-
:code:`make_zip_iterator` constructs and returns an instance of :code:`zip_iterator`
359+
``make_zip_iterator`` constructs and returns an instance of ``zip_iterator``
360360
using the set of source iterators provided.
361361

362362
Parallel Algorithms
363363
+++++++++++++++++++
364364

365-
The parallel algorithms are defined in the :code:`<oneapi/dpl/algorithm>` header,
366-
in :code:`namespace oneapi::dpl`.
365+
The parallel algorithms are defined in the ``<oneapi/dpl/algorithm>`` header,
366+
in ``namespace oneapi::dpl``.
367367

368368
.. code:: cpp
369369
@@ -383,17 +383,17 @@ in :code:`namespace oneapi::dpl`.
383383
BinaryOp binary_op =
384384
std::plus<typename std::iterator_traits<InputValueIt>::value_type>());
385385
386-
:code:`oneapi::dpl::exclusive_scan_by_segment` performs partial prefix scans by applying the
387-
:code:`binary_op` operation to a sequence of values. Each partial scan applies to a contiguous
386+
``oneapi::dpl::exclusive_scan_by_segment`` performs partial prefix scans by applying the
387+
``binary_op`` operation to a sequence of values. Each partial scan applies to a contiguous
388388
subsequence determined by the keys associated with the values being equal according to the
389-
:code:`binary_pred` predicate, and the first element of each scan is the initial value provided.
389+
``binary_pred`` predicate, and the first element of each scan is the initial value provided.
390390
The return value is an iterator targeting the end of the result sequence.
391391

392-
The initial value used if one is not provided is an instance of the :code:`value_type` of the
393-
:code:`InputValueIt` iterator type initialized to 0. If no binary predicate is provided for the
394-
comparison of keys an instance of :code:`std::equal_to` with the :code:`value_type` of the
395-
:code:`InputKeyIt` iterator type is used. Finally, an instance of :code:`std::plus` with the
396-
:code:`value_type` of the :code:`InputValueIt` iterator type is used if no binary operator is
392+
The initial value used if one is not provided is an instance of the ``value_type`` of the
393+
``InputValueIt`` iterator type initialized to 0. If no binary predicate is provided for the
394+
comparison of keys an instance of ``std::equal_to`` with the ``value_type`` of the
395+
``InputKeyIt`` iterator type is used. Finally, an instance of ``std::plus`` with the
396+
``value_type`` of the ``InputValueIt`` iterator type is used if no binary operator is
397397
provided to combine the elements of the value subsequences.
398398

399399
.. code:: cpp
@@ -412,15 +412,15 @@ provided to combine the elements of the value subsequences.
412412
BinaryOp binary_op =
413413
std::plus<typename std::iterator_traits<InputValueIt>::value_type>());
414414
415-
:code:`oneapi::dpl::inclusive_scan_by_segment` performs partial prefix scans by applying the
416-
:code:`binary_op` operation to a sequence of values. Each partial scan applies to a contiguous
415+
``oneapi::dpl::inclusive_scan_by_segment`` performs partial prefix scans by applying the
416+
``binary_op`` operation to a sequence of values. Each partial scan applies to a contiguous
417417
subsequence determined by the keys associated with the values being equal according to the
418-
:code:`binary_pred` predicate. The return value is an iterator targeting the end of the result
418+
``binary_pred`` predicate. The return value is an iterator targeting the end of the result
419419
sequence.
420420

421-
If no binary predicate is provided for the comparison of keys an instance of :code:`std::equal_to`
422-
with the :code:`value_type` of the :code:`InputKeyIt` iterator type is used. An instance of
423-
:code:`std::plus` with the :code:`value_type` of the :code:`InputValueIt` iterator type is used if
421+
If no binary predicate is provided for the comparison of keys an instance of ``std::equal_to``
422+
with the ``value_type`` of the ``InputKeyIt`` iterator type is used. An instance of
423+
``std::plus`` with the ``value_type`` of the ``InputValueIt`` iterator type is used if
424424
no binary operator is provided to combine the elements of the value subsequences.
425425

426426
.. code:: cpp
@@ -440,16 +440,16 @@ no binary operator is provided to combine the elements of the value subsequences
440440
BinaryOp binary_op =
441441
std::plus<typename std::iterator_traits<InputValueIt>::value_type>());
442442
443-
:code:`oneapi::dpl::reduce_by_segment` performs partial reductions on a sequence of values. Each
444-
reduction is computed with the :code:`binary_op` operation for a contiguous subsequence of values
445-
determined by the associated keys being equal according to the :code:`binary_pred` predicate.
446-
For each subsequence the first of the equal keys is stored into :code:`keys_result` and the computed
447-
reduction is stored into :code:`values_result`. The return value is a pair of
443+
``oneapi::dpl::reduce_by_segment`` performs partial reductions on a sequence of values. Each
444+
reduction is computed with the ``binary_op`` operation for a contiguous subsequence of values
445+
determined by the associated keys being equal according to the ``binary_pred`` predicate.
446+
For each subsequence the first of the equal keys is stored into ``keys_result`` and the computed
447+
reduction is stored into ``values_result``. The return value is a pair of
448448
iterators holding the end of the resulting sequences.
449449

450-
If no binary predicate is provided for the comparison of keys an instance of :code:`std::equal_to`
451-
with the :code:`value_type` of the :code:`InputKeyIt` iterator type is used. An instance of
452-
:code:`std::plus` with the :code:`value_type` of the :code:`InputValueIt` iterator type is used to
450+
If no binary predicate is provided for the comparison of keys an instance of ``std::equal_to``
451+
with the ``value_type`` of the ``InputKeyIt`` iterator type is used. An instance of
452+
``std::plus`` with the ``value_type`` of the ``InputValueIt`` iterator type is used to
453453
combine the values in each subsequence identified if a binary operator is not provided.
454454

455455
.. code:: cpp
@@ -463,16 +463,17 @@ combine the values in each subsequence identified if a binary operator is not pr
463463
Comparator comp =
464464
std::less<typename std::iterator_traits<InputIt1>::value_type>());
465465
466-
:code:`oneapi::dpl::binary_search` performs a binary search over the data in :code:`[start, end)`
467-
for each value in :code:`[value_first, value_last)`. If the value exists in the data searched then
468-
the corresponding element in :code:`[result, result + distance(value_first, value_last))` is set to
466+
``oneapi::dpl::binary_search`` performs a binary search over the data in ``[start, end)``
467+
for each value in ``[value_first, value_last)``. If the value exists in the data searched then
468+
the corresponding element in ``[result, result + distance(value_first, value_last))`` is set to
469469
true, otherwise it is set to false.
470470

471-
If no comparator is provided, :code:`operator<` is used to determine when the search value is less
471+
If no comparator is provided, ``operator<`` is used to determine when the search value is less
472472
than an element in the range being searched.
473473

474-
The elements e of [start, end) must be partitioned with respect to the comparator used. For all
475-
elements e in [start, end) and a given search value v in [value_first, value_last) comp(e, v) implies !comp(v, e).
474+
The elements of ``[start, end)`` must be partitioned with respect to the comparator used. For all
475+
elements ``e`` in ``[start, end)`` and a given search value ``v`` in ``[value_first, value_last)``,
476+
``comp(e, v)`` implies ``!comp(v, e)``.
476477

477478
.. code:: cpp
478479
@@ -485,16 +486,16 @@ elements e in [start, end) and a given search value v in [value_first, value_las
485486
Comparator comp =
486487
std::less<typename std::iterator_traits<InputIt1>::value_type>());
487488
488-
:code:`oneapi::dpl::lower_bound` performs a binary search over the data in :code:`[start, end)` for
489-
each value in :code:`[value_first, value_last)` to find the lowest index at which the search value
490-
could be inserted in :code:`[start, end)` without violating the ordering defined by the comparator
489+
``oneapi::dpl::lower_bound`` performs a binary search over the data in ``[start, end)`` for
490+
each value in ``[value_first, value_last)`` to find the lowest index at which the search value
491+
could be inserted in ``[start, end)`` without violating the ordering defined by the comparator
491492
provided. That lowest index is then assigned to the corresponding element in
492-
:code:`[result, result + distance(value_first, value_last))`.
493+
``[result, result + distance(value_first, value_last))``.
493494

494-
If no comparator is provided, :code:`operator<` is used to determine when the search value is less
495+
If no comparator is provided, ``operator<`` is used to determine when the search value is less
495496
than an element in the range being searched.
496497

497-
The elements e of [start, end) must be partitioned with respect to the comparator used.
498+
The elements of ``[start, end)`` must be partitioned with respect to the comparator used.
498499

499500
.. code:: cpp
500501
@@ -507,16 +508,16 @@ The elements e of [start, end) must be partitioned with respect to the comparato
507508
Comparator comp =
508509
std::less<typename std::iterator_traits<InputIt1>::value_type>());
509510
510-
:code:`oneapi::dpl::upper_bound` performs a binary search over the data in :code:`[start, end)`
511-
for each value in :code:`[value_first, value_last)` to find the highest index at which the search
512-
value could be inserted in :code:`[start, end)` without violating the ordering defined by the
511+
``oneapi::dpl::upper_bound`` performs a binary search over the data in ``[start, end)``
512+
for each value in ``[value_first, value_last)`` to find the highest index at which the search
513+
value could be inserted in ``[start, end)`` without violating the ordering defined by the
513514
comparator provided. That highest index is then assigned to the corresponding element in
514-
:code:`[result, result + distance(value_first, value_last))`.
515+
``[result, result + distance(value_first, value_last))``.
515516

516-
If no comparator is provided, :code:`operator<` is used to determine when the search value is less
517+
If no comparator is provided, ``operator<`` is used to determine when the search value is less
517518
than an element in the range being searched.
518519

519-
The elements e of [start, end) must be partitioned with respect to the comparator used.
520+
The elements of ``[start, end)`` must be partitioned with respect to the comparator used.
520521

521522
.. _`C++ Standard`: https://isocpp.org/std/the-standard
522523
.. _`SYCL`: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html

source/elements/oneDPL/source/parallel_api/execution_policies.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
..
44
.. SPDX-License-Identifier: CC-BY-4.0
55
6-
Execution policies
6+
Execution Policies
77
------------------
88

9-
C++ Standard aligned execution policies
9+
C++ Standard Aligned Execution Policies
1010
+++++++++++++++++++++++++++++++++++++++
1111

1212
oneDPL has the set of execution policies and related utilities that are semantically aligned
@@ -44,7 +44,7 @@ See "Execution policies" in the `C++ Standard`_ for more information.
4444
Device Execution Policy
4545
+++++++++++++++++++++++
4646

47-
A device execution policy class :code:`oneapi::dpl::execution::device_policy` specifies
47+
A device execution policy class ``oneapi::dpl::execution::device_policy`` specifies
4848
the `SYCL`_ device and queue to run oneDPL algorithms.
4949

5050
.. code:: cpp
@@ -77,7 +77,7 @@ the `SYCL`_ device and queue to run oneDPL algorithms.
7777
7878
``dpcpp_default`` is a predefined execution policy object to run algorithms on the default `SYCL`_ device.
7979

80-
device_policy class
80+
device_policy Class
8181
^^^^^^^^^^^^^^^^^^^
8282

8383
.. code:: cpp
@@ -100,7 +100,7 @@ device_policy class
100100
101101
An object of the ``device_policy`` type is associated with a ``sycl::queue`` that is used
102102
to run algorithms on a SYCL device. When an algorithm runs with ``device_policy``
103-
it is capable of processing SYCL buffers (passed via :code:`oneapi::dpl::begin/end`),
103+
it is capable of processing SYCL buffers (passed via ``oneapi::dpl::begin/end``),
104104
data in the host memory and data in Unified Shared Memory (USM), including USM device memory.
105105
Data placed in the host memory and USM can only be passed to oneDPL algorithms
106106
as pointers and random access iterators. The way to transfer data from the host memory
@@ -148,7 +148,7 @@ Return the queue the policy is associated with.
148148
149149
Allow implicit conversion of the policy to a ``sycl::queue`` object.
150150

151-
make_device_policy function
151+
make_device_policy Function
152152
^^^^^^^^^^^^^^^^^^^^^^^^^^^
153153

154154
The ``make_device_policy`` function templates simplify ``device_policy`` creation.

0 commit comments

Comments
 (0)