generate¶
Header: <Kokkos_StdAlgorithms.hpp>
Description¶
Assigns the value generated by the functor g to each elements in the
range [first, last) (overloads 1,2,5) or in the view (overloads 3,4,6).
Interface¶
Warning
This is currently inside the Kokkos::Experimental namespace.
Overload set accepting execution space¶
template <class ExecutionSpace, class IteratorType, class GeneratorType>
void generate(const ExecutionSpace& exespace, (1)
IteratorType first, IteratorType last,
GeneratorType g);
template <class ExecutionSpace, class IteratorType, class GeneratorType>
void generate(const std::string& label, const ExecutionSpace& exespace, (2)
IteratorType first, IteratorType last,
GeneratorType g);
template <class ExecutionSpace, class DataType, class... Properties, class GeneratorType>
void generate(const ExecutionSpace& exespace, (3)
const Kokkos::View<DataType, Properties...>& view,
GeneratorType g);
template <class ExecutionSpace, class DataType, class... Properties, class GeneratorType>
void generate(const std::string& label, const ExecutionSpace& exespace, (4)
const Kokkos::View<DataType, Properties...>& view,
GeneratorType g);
Overload set accepting a team handle¶
Added in version 4.2.
template <class TeamHandleType, class IteratorType, class GeneratorType>
KOKKOS_FUNCTION
void generate(const TeamHandleType& teamHandle, (5)
IteratorType first, IteratorType last,
GeneratorType g);
template <class TeamHandleType, class DataType, class... Properties, class GeneratorType>
KOKKOS_FUNCTION
void generate(const TeamHandleType& teamHandle, (6)
const Kokkos::View<DataType, Properties...>& view,
GeneratorType g);
Parameters and Requirements¶
exespace: execution space instanceteamHandle: team handle instance given inside a parallel region when using a TeamPolicylabel: used to name the implementation kernels for debugging purposesfor 1, the default string is: “Kokkos::generate_iterator_api_default”
for 3, the default string is: “Kokkos::generate_view_api_default”
NOTE: overloads accepting a team handle do not use a label internally
first, last: range of elements to modifymust be random access iterators
must represent a valid range, i.e.,
last >= first(checked in debug mode)must be accessible from
exespaceor from the execution space associated with the team handle
view: view to modifymust be rank-1, and have
LayoutLeft,LayoutRight, orLayoutStridemust be accessible from
exespaceor from the execution space associated with the team handle
g:functor of the following form, where
return_typemust be assignable tovalue_type, withvalue_typebeing the value type ofIteratorTypeor ofview:
struct Generate { KOKKOS_INLINE_FUNCTION return_type operator()() const{ return /* ... */; } };
Return Value¶
None