Header File: Kokkos_StdAlgorithms.hpp
namespace Kokkos{
namespace Experimental{
template <
class ExecutionSpace, class InputIteratorType,
class OutputIteratorType, class ValueType,
class BinaryOpType, class UnaryOpType>
OutputIteratorType transform_exclusive_scan(const ExecutionSpace& exespace, (1)
InputIteratorType first_from,
InputIteratorType last_from,
OutputIteratorType first_dest,
ValueType init_value,
BinaryOpType binary_op,
UnaryOpType unary_op);
template <
class ExecutionSpace, class InputIteratorType,
class OutputIteratorType, class ValueType,
class BinaryOpType, class UnaryOpType>
OutputIteratorType transform_exclusive_scan(const std::string& label, (2)
const ExecutionSpace& exespace,
InputIteratorType first_from,
InputIteratorType last_from,
OutputIteratorType first_dest,
ValueType init_value,
BinaryOpType binary_op,
UnaryOpType unary_op);
template <
class ExecutionSpace,
class DataType1, class... Properties1,
class DataType2, class... Properties2,
class ValueType, class BinaryOpType, class UnaryOpType>
auto transform_exclusive_scan(const ExecutionSpace& exespace, (3)
const ::Kokkos::View<DataType1, Properties1...>& view_from,
const ::Kokkos::View<DataType2, Properties2...>& view_dest,
ValueType init_value, BinaryOpType binary_op,
UnaryOpType unary_op);
template <
class ExecutionSpace,
class DataType1, class... Properties1,
class DataType2, class... Properties2,
class ValueType, class BinaryOpType, class UnaryOpType>
auto transform_exclusive_scan(const std::string& label, (4)
const ExecutionSpace& exespace,
const ::Kokkos::View<DataType1, Properties1...>& view_from,
const ::Kokkos::View<DataType2, Properties2...>& view_dest,
ValueType init_value, BinaryOpType binary_op,
UnaryOpType unary_op);
} //end namespace Experimental
} //end namespace Kokkos
-
1,2: transforms each element in the range
[first_from, last_from)
withunary_op
, then computes an exclusive prefix scan operation usingbinary_op
over the resulting range, withinit
as the initial value, and writes the results to the range beginning atfirst_dest
. "exclusive" means that the i-th input element is not included in the i-th sum -
3,4: same as (1,2) except that the elements are read from
view_from
and written toview_dest
exespace
,first_from
,first_last
,first_dest
,view_from
,view_dest
:- same as
exclusive_scan
- same as
label
:- used to name the implementation kernels for debugging purposes
- for 1 the default string is: "Kokkos::transform_exclusive_scan_iterator_api_default"
- for 3 the default string is: "Kokkos::transform_exclusive_scan_view_api_default"
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
, wherevalue_type
is the value type offirst_from
(for 1,2) or the value type ofview_from
(for 3,4), and must not modifyv
. - Must conform to:
struct UnaryOp { KOKKOS_FUNCTION constexpr value_type operator()(const value_type & v) const { return /* ... */ } };
- 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
Iterator to the element after the last element written.