``generate`` ============ Header: ```` 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: cpp template void generate(const ExecutionSpace& exespace, (1) IteratorType first, IteratorType last, GeneratorType g); template void generate(const std::string& label, const ExecutionSpace& exespace, (2) IteratorType first, IteratorType last, GeneratorType g); template void generate(const ExecutionSpace& exespace, (3) const Kokkos::View& view, GeneratorType g); template void generate(const std::string& label, const ExecutionSpace& exespace, (4) const Kokkos::View& view, GeneratorType g); Overload set accepting a team handle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 4.2 .. code-block:: cpp template KOKKOS_FUNCTION void generate(const TeamHandleType& teamHandle, (5) IteratorType first, IteratorType last, GeneratorType g); template KOKKOS_FUNCTION void generate(const TeamHandleType& teamHandle, (6) const Kokkos::View& view, GeneratorType g); Parameters and Requirements ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ``exespace``: execution space instance - ``teamHandle``: team handle instance given inside a parallel region when using a TeamPolicy - ``label``: used to name the implementation kernels for debugging purposes - for 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 modify - must be *random access iterators* - must represent a valid range, i.e., ``last >= first`` (checked in debug mode) - must be accessible from ``exespace`` or from the execution space associated with the team handle - ``view``: view to modify - must be rank-1, and have ``LayoutLeft``, ``LayoutRight``, or ``LayoutStride`` - must be accessible from ``exespace`` or from the execution space associated with the team handle - ``g``: - functor of the following form, where ``return_type`` must be assignable to ``value_type``, with ``value_type`` being the value type of ``IteratorType`` or of ``view``: .. code-block:: cpp struct Generate { KOKKOS_INLINE_FUNCTION return_type operator()() const{ return /* ... */; } }; Return Value ~~~~~~~~~~~~ None