Skip to content

Commit 2372e84

Browse files
committed
progress
1 parent 8e43724 commit 2372e84

File tree

8 files changed

+235
-209
lines changed

8 files changed

+235
-209
lines changed

docs/source/API/algorithms/std-algorithms/all/StdAdjacentDifference.rst

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
``adjacent_difference``
22
=======================
33

4-
Header: ``Kokkos_StdAlgorithms.hpp``
4+
Header: ``<Kokkos_StdAlgorithms.hpp>``
55

66
Description
77
-----------
88

9-
First, a copy of ``*first_from`` is written to ``*first_dest``, or a copy of ``view_from(0)`` is written to ``view_dest(0)``.
10-
Second, it computes the *difference* or calls the binary functor between the second and the first of each adjacent pair of elements of a range or in ``view_from``, and writes them to the range beginning at ``first_dest + 1``, or ``view_dest``.
9+
This function performs the following two operations.
10+
First, a copy of ``*first_from`` is written to ``*first_dest``, or a copy of ``view_from(0)``
11+
is written to ``view_dest(0)``.
12+
Second, it computes the *difference* or calls the binary functor between the second and
13+
the first of each adjacent pair of elements of a range or in ``view_from``,
14+
and writes them to the range beginning at ``first_dest + 1``, or ``view_dest``.
1115

1216
Interface
1317
---------
1418

1519
.. warning:: This is currently inside the ``Kokkos::Experimental`` namespace.
1620

21+
Overload set accepting execution space
22+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23+
1724
.. code-block:: cpp
1825
19-
//
20-
// overload set accepting execution space
21-
//
2226
template <
2327
class ExecutionSpace,
2428
class InputIteratorType, class OutputIteratorType>
@@ -57,9 +61,6 @@ Interface
5761
OutputIteratorType first_dest,
5862
BinaryOp bin_op);
5963
60-
//
61-
// overload set accepting views
62-
//
6364
template <
6465
class ExecutionSpace,
6566
class DataType1, class... Properties1,
@@ -98,9 +99,13 @@ Interface
9899
const Kokkos::View<DataType2, Properties2...>& view_dest,
99100
BinaryOp bin_op);
100101
101-
//
102-
// overload set accepting a team handle
103-
//
102+
Overload set accepting a team handle
103+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104+
105+
.. versionadded:: 4.2
106+
107+
.. code-block:: cpp
108+
104109
template <
105110
class TeamHandleType,
106111
class InputIteratorType, class OutputIteratorType>
@@ -150,21 +155,21 @@ Parameters and Requirements
150155

151156
- ``label``: string forwarded to internal parallel kernels for debugging purposes
152157

153-
- 1 & 2: The default string is "Kokkos::adjacent_difference_iterator_api"
158+
- 1, 2: The default string is "Kokkos::adjacent_difference_iterator_api"
154159

155-
- 5 & 6: The default string is "Kokkos::adjacent_difference_view_api"
160+
- 5, 6: The default string is "Kokkos::adjacent_difference_view_api"
156161

157162
- NOTE: overloads accepting a team handle do not use a label internally
158163

159-
- ``first_from``, ``last_from``, ``first_dest``: range of elements to read from ``*_from`` and write to ``first_dest``
164+
- ``first_from``, ``last_from``, ``first_dest``: range of elements to read from and write to
160165

161166
- must be *random access iterators*, e.g., returned from ``Kokkos::Experimental::(c)begin/(c)end``
162167

163168
- must represent a valid range, i.e., ``last_from >= first_from``
164169

165170
- must be accessible from ``exespace`` or from the execution space associated with the team handle
166171

167-
- ``view_from``, ``view_dest``: views to read elements from ``view_from`` and write to ``view_dest``
172+
- ``view_from``, ``view_dest``: views to read elements from and write to
168173

169174
- must be rank-1, and have ``LayoutLeft``, ``LayoutRight``, or ``LayoutStride``
170175

@@ -200,4 +205,4 @@ Parameters and Requirements
200205
Return Value
201206
~~~~~~~~~~~~
202207

203-
Iterator to the element *after* the last element written.
208+
Iterator to the element *after* the last element written.

docs/source/API/algorithms/std-algorithms/all/StdExclusiveScan.rst

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Interface
2121

2222
.. warning:: This is currently inside the ``Kokkos::Experimental`` namespace.
2323

24+
Overload set accepting execution space
25+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26+
2427
.. code-block:: cpp
2528
26-
//
27-
// overload set A
28-
//
2929
template <
3030
class ExecutionSpace, class InputIteratorType,
3131
class OutputIteratorType, class ValueType>
@@ -65,34 +65,10 @@ Interface
6565
const Kokkos::View<DataType2, Properties2...>& view_dest,
6666
ValueType init_value);
6767
68-
template <
69-
class TeamHandleType, class InputIteratorType,
70-
class OutputIteratorType, class ValueType>
71-
KOKKOS_FUNCTION
72-
OutputIteratorType exclusive_scan(const TeamHandleType& teamHandle, (5)
73-
InputIteratorType first,
74-
InputIteratorType last,
75-
OutputIteratorType first_dest,
76-
ValueType init_value);
77-
78-
template <
79-
class TeamHandleType,
80-
class DataType1, class... Properties1,
81-
class DataType2, class... Properties2,
82-
class ValueType>
83-
KOKKOS_FUNCTION
84-
auto exclusive_scan(const TeamHandleType& teamHandle, (6)
85-
const Kokkos::View<DataType1, Properties1...>& view_from,
86-
const Kokkos::View<DataType2, Properties2...>& view_dest,
87-
ValueType init_value);
88-
89-
//
90-
// overload set B
91-
//
9268
template <
9369
class ExecutionSpace, class InputIteratorType,
9470
class OutputIteratorType, class ValueType, class BinaryOpType>
95-
OutputIteratorType exclusive_scan(const ExecutionSpace& exespace, (7)
71+
OutputIteratorType exclusive_scan(const ExecutionSpace& exespace, (5)
9672
InputIteratorType first,
9773
InputIteratorType last,
9874
OutputIteratorType first_dest,
@@ -101,7 +77,7 @@ Interface
10177
template <
10278
class ExecutionSpace, class InputIteratorType,
10379
class OutputIteratorType, class ValueType, class BinaryOpType>
104-
OutputIteratorType exclusive_scan(const std::string& label, (8)
80+
OutputIteratorType exclusive_scan(const std::string& label, (6)
10581
const ExecutionSpace& exespace,
10682
InputIteratorType first,
10783
InputIteratorType last,
@@ -114,7 +90,7 @@ Interface
11490
class DataType1, class... Properties1,
11591
class DataType2, class... Properties2,
11692
class ValueType, class BinaryOpType>
117-
auto exclusive_scan(const ExecutionSpace& exespace, (9)
93+
auto exclusive_scan(const ExecutionSpace& exespace, (7)
11894
const Kokkos::View<DataType1, Properties1...>& view_from,
11995
const Kokkos::View<DataType2, Properties2...>& view_dest,
12096
ValueType init_value, BinaryOpType bop);
@@ -124,12 +100,42 @@ Interface
124100
class DataType1, class... Properties1,
125101
class DataType2, class... Properties2,
126102
class ValueType, class BinaryOpType>
127-
auto exclusive_scan(const std::string& label, (10)
103+
auto exclusive_scan(const std::string& label, (8)
128104
const ExecutionSpace& exespace,
129105
const Kokkos::View<DataType1, Properties1...>& view_from,
130106
const Kokkos::View<DataType2, Properties2...>& view_dest,
131107
ValueType init_value, BinaryOpType bop);
132108
109+
110+
Overload set accepting a team handle
111+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112+
113+
.. versionadded:: 4.2
114+
115+
.. code-block:: cpp
116+
117+
template <
118+
class TeamHandleType, class InputIteratorType,
119+
class OutputIteratorType, class ValueType>
120+
KOKKOS_FUNCTION
121+
OutputIteratorType exclusive_scan(const TeamHandleType& teamHandle, (9)
122+
InputIteratorType first,
123+
InputIteratorType last,
124+
OutputIteratorType first_dest,
125+
ValueType init_value);
126+
127+
template <
128+
class TeamHandleType,
129+
class DataType1, class... Properties1,
130+
class DataType2, class... Properties2,
131+
class ValueType>
132+
KOKKOS_FUNCTION
133+
auto exclusive_scan(const TeamHandleType& teamHandle, (10)
134+
const Kokkos::View<DataType1, Properties1...>& view_from,
135+
const Kokkos::View<DataType2, Properties2...>& view_dest,
136+
ValueType init_value);
137+
138+
133139
template <
134140
class TeamHandleType, class InputIteratorType,
135141
class OutputIteratorType, class ValueType, class BinaryOpType>
@@ -209,4 +215,4 @@ Parameters and Requirements
209215
Return Value
210216
~~~~~~~~~~~~
211217

212-
Iterator to the element *after* the last element written.
218+
Iterator to the element *after* the last element written.

docs/source/API/algorithms/std-algorithms/all/StdInclusiveScan.rst

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Interface
1414

1515
.. warning:: This is currently inside the ``Kokkos::Experimental`` namespace.
1616

17+
Overload set accepting execution space
18+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19+
1720
.. code-block:: cpp
1821
19-
//
20-
// overload set A
21-
//
2222
template <class ExecutionSpace, class InputIteratorType, class OutputIteratorType>
2323
OutputIteratorType inclusive_scan(const ExecutionSpace& exespace, (1)
2424
InputIteratorType first_from,
@@ -65,9 +65,6 @@ Interface
6565
const Kokkos::View<DataType1, Properties1...>& view_from,
6666
const Kokkos::View<DataType2, Properties2...>& view_dest);
6767
68-
//
69-
// overload set B
70-
//
7168
template <
7269
class ExecutionSpace, class InputIteratorType,
7370
class OutputIteratorType, class BinaryOp>
@@ -108,35 +105,11 @@ Interface
108105
const Kokkos::View<DataType2, Properties2...>& view_dest,
109106
BinaryOp binary_op);
110107
111-
template <
112-
class TeamHandleType, class InputIteratorType,
113-
class OutputIteratorType, class BinaryOp>
114-
KOKKOS_FUNCTION
115-
OutputIteratorType inclusive_scan(const TeamHandleType& teamHandle, (11)
116-
InputIteratorType first_from,
117-
InputIteratorType last_from,
118-
OutputIteratorType first_dest,
119-
BinaryOp binary_op);
120-
121-
template <
122-
class TeamHandleType,
123-
class DataType1, class... Properties1,
124-
class DataType2, class... Properties2,
125-
class BinaryOp>
126-
KOKKOS_FUNCTION
127-
auto inclusive_scan(const TeamHandleType& teamHandle, (12)
128-
const Kokkos::View<DataType1, Properties1...>& view_from,
129-
const Kokkos::View<DataType2, Properties2...>& view_dest,
130-
BinaryOp binary_op);
131-
132-
//
133-
// overload set C
134-
//
135108
template <
136109
class ExecutionSpace,
137110
class InputIteratorType, class OutputIteratorType,
138111
class BinaryOp, class ValueType>
139-
OutputIteratorType inclusive_scan(const ExecutionSpace& exespace, (13)
112+
OutputIteratorType inclusive_scan(const ExecutionSpace& exespace, (11)
140113
InputIteratorType first_from,
141114
InputIteratorType last_from,
142115
OutputIteratorType first_dest,
@@ -146,7 +119,7 @@ Interface
146119
template <
147120
class ExecutionSpace, class InputIteratorType,
148121
class OutputIteratorType, class BinaryOp, class ValueType>
149-
OutputIteratorType inclusive_scan(const std::string& label, (14)
122+
OutputIteratorType inclusive_scan(const std::string& label, (12)
150123
const ExecutionSpace& exespace,
151124
InputIteratorType first_from,
152125
InputIteratorType last_from,
@@ -159,7 +132,7 @@ Interface
159132
class DataType1, class... Properties1,
160133
class DataType2, class... Properties2,
161134
class BinaryOp, class ValueType>
162-
auto inclusive_scan(const ExecutionSpace& exespace, (15)
135+
auto inclusive_scan(const ExecutionSpace& exespace, (13)
163136
const Kokkos::View<DataType1, Properties1...>& view_from,
164137
const Kokkos::View<DataType2, Properties2...>& view_dest,
165138
BinaryOp binary_op,
@@ -170,13 +143,43 @@ Interface
170143
class DataType1, class... Properties1,
171144
class DataType2, class... Properties2,
172145
class BinaryOp, class ValueType>
173-
auto inclusive_scan(const std::string& label, (16)
146+
auto inclusive_scan(const std::string& label, (14)
174147
const ExecutionSpace& exespace,
175148
const Kokkos::View<DataType1, Properties1...>& view_from,
176149
const Kokkos::View<DataType2, Properties2...>& view_dest,
177150
BinaryOp binary_op,
178151
ValueType init_value);
179152
153+
154+
Overload set accepting a team handle
155+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156+
157+
.. versionadded:: 4.2
158+
159+
.. code-block:: cpp
160+
161+
template <
162+
class TeamHandleType, class InputIteratorType,
163+
class OutputIteratorType, class BinaryOp>
164+
KOKKOS_FUNCTION
165+
OutputIteratorType inclusive_scan(const TeamHandleType& teamHandle, (15)
166+
InputIteratorType first_from,
167+
InputIteratorType last_from,
168+
OutputIteratorType first_dest,
169+
BinaryOp binary_op);
170+
171+
template <
172+
class TeamHandleType,
173+
class DataType1, class... Properties1,
174+
class DataType2, class... Properties2,
175+
class BinaryOp>
176+
KOKKOS_FUNCTION
177+
auto inclusive_scan(const TeamHandleType& teamHandle, (16)
178+
const Kokkos::View<DataType1, Properties1...>& view_from,
179+
const Kokkos::View<DataType2, Properties2...>& view_dest,
180+
BinaryOp binary_op);
181+
182+
180183
template <
181184
class TeamHandleType, class InputIteratorType,
182185
class OutputIteratorType, class BinaryOp, class ValueType>
@@ -225,4 +228,4 @@ Parameters and Requirements
225228
Return Value
226229
~~~~~~~~~~~~
227230

228-
Iterator to the element *after* the last element written.
231+
Iterator to the element *after* the last element written.

0 commit comments

Comments
 (0)