Skip to content

Commit 03e0fd9

Browse files
committed
Prototype a custom role for highlighting spec modifications
1 parent 5232315 commit 03e0fd9

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

doc/main/reference/rvalue_reduce.rst

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,59 @@ Parallel Reduction for rvalues
77
:local:
88
:depth: 1
99

10+
.. role:: specext
11+
12+
.. raw:: html
13+
<style> .specext {background-color:yellow;} </style>
14+
1015
Description
1116
***********
1217

1318
|full_name| implementation extends the `ParallelReduceFunc <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/named_requirements/algorithms/par_reduce_func>`_ and
1419
`ParallelReduceReduction <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/named_requirements/algorithms/par_reduce_reduction>`_
1520
to optimize operating with ``rvalues`` using functional form of ``tbb::parallel_reduce`` and ``tbb::parallel_deterministic_reduce`` algorithms.
1621

17-
API
18-
***
19-
20-
Header
21-
------
22-
23-
.. code:: cpp
22+
Extensions
23+
**********
2424

25-
#include <oneapi/tbb/parallel_reduce.h>
25+
Modifications of the API specifications are :specext:`highlighted`.
2626

27-
ParallelReduceFunc Requirements: Pseudo-Signature, Semantics
28-
------------------------------------------------------------
27+
**ParallelReduceFunc Requirements: Pseudo-Signature, Semantics**
2928

30-
.. cpp:function:: Value Func::operator()(const Range& range, Value&& x) const
29+
.. cpp:function:: :specext:`Value Func::operator()(const Range& range, Value&& x) const`
3130

32-
or
31+
:specext:`or`
3332

3433
.. cpp:function:: Value Func::operator()(const Range& range, const Value& x) const
3534

36-
Accumulates the result for a subrange, starting with initial value ``x``. The ``Range`` type must meet the
35+
Accumulates the result for a subrange, starting with initial value ``x``.
36+
The ``Range`` type must meet the
3737
`Range requirements <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/named_requirements/algorithms/range>`_.
38-
The ``Value`` type must be the same as a corresponding template parameter for the `parallel_reduce algorithm <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/algorithms/functions/parallel_reduce_func>`_.
38+
The ``Value`` type must be the same as a corresponding template parameter for the
39+
`parallel_reduce algorithm <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/algorithms/functions/parallel_reduce_func>`_.
40+
41+
:specext:`If both ``rvalue`` and ``lvalue`` forms are provided, the ``rvalue`` is preferred.`
42+
43+
**ParallelReduceReduction Requirements: Pseudo-Signature, Semantics**
44+
45+
.. cpp:function:: Value Reduction::operator()(const Value& x, const Value& y) const
3946

40-
If both ``rvalue`` and ``lvalue`` forms are provided, the ``rvalue`` is preferred.
47+
Combines results ``x`` and ``y``.
48+
``Value`` type must be the same as a corresponding template parameter for the
49+
:doc:`parallel_reduce algorithm <../../algorithms/functions/parallel_reduce_func>` algorithm.
4150

42-
ParallelReduceReduction Requirements: Pseudo-Signature, Semantics
43-
-----------------------------------------------------------------
4451

45-
.. cpp:function:: Value Reduction::operator()(Value&& x, Value&& y) const
52+
.. cpp:function:: :specext:`Value Reduction::operator()(Value&& x, Value&& y) const`
4653

47-
or
54+
:specext:`or`
4855

4956
.. cpp:function:: Value Reduction::operator()(const Value& x, const Value& y) const
5057

51-
Combines the ``x`` and ``y`` results. The ``Value`` type must be the same as a corresponding template parameter for the `parallel_reduce algorithm <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/algorithms/functions/parallel_reduce_func>`_.
58+
Combines the ``x`` and ``y`` results.
59+
The ``Value`` type must be the same as a corresponding template parameter for the
60+
`parallel_reduce algorithm <https://oneapi-spec.uxlfoundation.org/specifications/oneapi/latest/elements/onetbb/source/algorithms/functions/parallel_reduce_func>`_.
5261

53-
If both ``rvalue`` and ``lvalue`` forms are provided, the ``rvalue`` is preferred.
62+
:specext:`If both ``rvalue`` and ``lvalue`` forms are provided, the ``rvalue`` is preferred.`
5463

5564
Example
5665
*******

0 commit comments

Comments
 (0)