Skip to content

Commit

Permalink
update , NOT final
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Dec 19, 2023
1 parent 2372e84 commit 141852d
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Header: ``Kokkos_StdAlgorithms.hpp``
Description
-----------

Computes an inclusive prefix scan over a range or a ``view_from`` using the binary op ``bin_op`` to combine two elements, and ``init`` as the initial value, and writes the results to the range beginning at ``first_dest`` or to ``view_dest``.
Computes an inclusive prefix scan over a range or a ``view_from`` using the binary op ``bin_op`` to combine two elements,
and ``init`` as the initial value, and writes the results to the range beginning at ``first_dest`` or to ``view_dest``.
Inclusive means that the i-th input element is included in the i-th sum.

Interface
Expand Down
93 changes: 50 additions & 43 deletions docs/source/API/algorithms/std-algorithms/all/StdReduce.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,105 +33,112 @@ Overload set accepting execution space
IteratorType first,
IteratorType last);
template <class TeamHandleType, class IteratorType>
KOKKOS_FUNCTION
typename IteratorType::value_type reduce(const TeamHandleType& teamHandle, (3)
IteratorType first,
IteratorType last);
template <class ExecutionSpace, class DataType, class... Properties>
auto reduce(const ExecutionSpace& exespace, (4)
auto reduce(const ExecutionSpace& exespace, (3)
const Kokkos::View<DataType, Properties...>& view)
template <class ExecutionSpace, class DataType, class... Properties>
auto reduce(const std::string& label, const ExecutionSpace& exespace, (5)
auto reduce(const std::string& label, const ExecutionSpace& exespace, (4)
const Kokkos::View<DataType, Properties...>& view);
template <class TeamHandleType, class DataType, class... Properties>
KOKKOS_FUNCTION
auto reduce(const TeamHandleType& teamHandle, (6)
const Kokkos::View<DataType, Properties...>& view)
template <class ExecutionSpace, class IteratorType, class ValueType>
ValueType reduce(const ExecutionSpace& exespace, (7)
ValueType reduce(const ExecutionSpace& exespace, (5)
IteratorType first, IteratorType last,
ValueType init_reduction_value);
template <class ExecutionSpace, class IteratorType, class ValueType>
ValueType reduce(const std::string& label, (8)
ValueType reduce(const std::string& label, (6)
const ExecutionSpace& exespace,
IteratorType first, IteratorType last,
ValueType init_reduction_value);
template <class TeamHandleType, class IteratorType, class ValueType>
KOKKOS_FUNCTION
ValueType reduce(const TeamHandleType& teamHandle, (9)
IteratorType first, IteratorType last,
ValueType init_reduction_value);
template <
class ExecutionSpace, class DataType,
class... Properties, class ValueType>
ValueType reduce(const ExecutionSpace& exespace, (10)
ValueType reduce(const ExecutionSpace& exespace, (7)
const Kokkos::View<DataType, Properties...>& view,
ValueType init_reduction_value);
template <
class ExecutionSpace, class DataType,
class... Properties, class ValueType>
ValueType reduce(const std::string& label, (11)
ValueType reduce(const std::string& label, (8)
const ExecutionSpace& exespace,
const Kokkos::View<DataType, Properties...>& view,
ValueType init_reduction_value);
template <
class TeamHandleType, class DataType,
class... Properties, class ValueType>
KOKKOS_FUNCTION
ValueType reduce(const TeamHandleType& teamHandle, (12)
const Kokkos::View<DataType, Properties...>& view,
ValueType init_reduction_value);
template <
class ExecutionSpace, class IteratorType,
class ValueType, class BinaryOp>
ValueType reduce(const ExecutionSpace& exespace, (13)
ValueType reduce(const ExecutionSpace& exespace, (9)
IteratorType first, IteratorType last,
ValueType init_reduction_value,
BinaryOp joiner);
template <
class ExecutionSpace, class IteratorType,
class ValueType, class BinaryOp>
ValueType reduce(const std::string& label, (14)
ValueType reduce(const std::string& label, (10)
const ExecutionSpace& exespace,
IteratorType first, IteratorType last,
ValueType init_reduction_value,
BinaryOp joiner);
template <
class TeamHandleType, class IteratorType,
class ValueType, class BinaryOp>
KOKKOS_FUNCTION
ValueType reduce(const TeamHandleType& teamHandle, (15)
IteratorType first, IteratorType last,
class ExecutionSpace, class DataType,
class... Properties, class ValueType, class BinaryOp>
ValueType reduce(const ExecutionSpace& exespace, (11)
const Kokkos::View<DataType, Properties...>& view,
ValueType init_reduction_value,
BinaryOp joiner);
template <
class ExecutionSpace, class DataType,
class... Properties, class ValueType, class BinaryOp>
ValueType reduce(const ExecutionSpace& exespace, (16)
ValueType reduce(const std::string& label, (12)
const ExecutionSpace& exespace,
const Kokkos::View<DataType, Properties...>& view,
ValueType init_reduction_value,
BinaryOp joiner);
Overload set accepting a team handle
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 4.2

.. code-block:: cpp
template <class TeamHandleType, class IteratorType>
KOKKOS_FUNCTION
typename IteratorType::value_type reduce(const TeamHandleType& teamHandle, (13)
IteratorType first,
IteratorType last);
template <class TeamHandleType, class DataType, class... Properties>
KOKKOS_FUNCTION
auto reduce(const TeamHandleType& teamHandle, (14)
const Kokkos::View<DataType, Properties...>& view)
template <class TeamHandleType, class IteratorType, class ValueType>
KOKKOS_FUNCTION
ValueType reduce(const TeamHandleType& teamHandle, (15)
IteratorType first, IteratorType last,
ValueType init_reduction_value);
template <
class ExecutionSpace, class DataType,
class... Properties, class ValueType, class BinaryOp>
ValueType reduce(const std::string& label, (17)
const ExecutionSpace& exespace,
class TeamHandleType, class DataType,
class... Properties, class ValueType>
KOKKOS_FUNCTION
ValueType reduce(const TeamHandleType& teamHandle, (16)
const Kokkos::View<DataType, Properties...>& view,
ValueType init_reduction_value);
template <
class TeamHandleType, class IteratorType,
class ValueType, class BinaryOp>
KOKKOS_FUNCTION
ValueType reduce(const TeamHandleType& teamHandle, (17)
IteratorType first, IteratorType last,
ValueType init_reduction_value,
BinaryOp joiner);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Header: ``Kokkos_StdAlgorithms.hpp``
Description
-----------

Transforms each element in a range or a ``view`` with ``unary_op`` then computes an exclusive prefix scan operation using ``binary_op`` over the resulting range, with ``init`` as the initial value, and writes the results to the range beginning at ``first_dest`` or to ``view_dest``.
Transforms each element in a range or a ``view`` with ``unary_op`` then computes an exclusive
prefix scan operation using ``binary_op`` over the resulting range, with ``init`` as the initial value,
and writes the results to the range beginning at ``first_dest`` or to ``view_dest``.
"exclusive" means that the i-th input element is not included in the i-th sum.

Interface
Expand Down Expand Up @@ -122,7 +124,10 @@ Parameters and Requirements

- ``unary_op``:

- *unary* functor performing the desired transformation operation to an element. Must be valid to be called from the execution space passed, and callable with an arguments ``v`` of type (possible const) ``value_type``, where ``value_type`` is the value type of ``first_from`` or value type of ``view_from``, and must not modify ``v``.
- *unary* functor performing the desired transformation operation to an element.
Must be valid to be called from the execution space passed, and callable with ``v`` of type
(possible const) ``value_type``, where ``value_type`` is the value type of ``first_from``
or value type of ``view_from``, and must not modify ``v``.

- Must conform to:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ Parameters and Requirements

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

- 1 & 3: The default string is "Kokkos::transform_reduce_default_functors_iterator_api"
- 1, 3: The default string is "Kokkos::transform_reduce_default_functors_iterator_api"

- 7 & 13: The default string is "Kokkos::transform_reduce_custom_functors_iterator_api"
- 7, 13: The default string is "Kokkos::transform_reduce_custom_functors_iterator_api"

- 9 & 15: The default string is "Kokkos::transform_reduce_custom_functors_view_api"
- 9, 15: The default string is "Kokkos::transform_reduce_custom_functors_view_api"

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

Expand Down

0 comments on commit 141852d

Please sign in to comment.