Struct TempLat::device_kokkos::KokkosNDLambdaWrapperReduction
template <size_t NDim, typename FUN>
ClassList > TempLat > device_kokkos > KokkosNDLambdaWrapperReduction
This is a functor which wraps a lambda for reduction. Basically, this is necessary when one wants to call a variadic lambda on an NVIDIA GPU. CUDA seems to be unable to expand the variadic arguments - in contrast, a direct approach does indeed work for openMP or serial compilation. To get around this limitation, the KokkosNDLambdaWrapperReduction packs the indices into an array. If you wonder, whether there's a difference when using tie and tuples:https://godbolt.org/z/M3bG39rsM No. Therefore, we spare the ourselves the hassle and simply use an array.More...
#include <kokkos_internal.h>
Public Attributes
| Type | Name |
|---|---|
| FUN | fun |
Public Functions
| Type | Name |
|---|---|
| KokkosNDLambdaWrapperReduction (const FUN & _fun) |
|
| DEVICE_INLINE_FUNCTION auto | makeArray (device_kokkos::tuple< Args... > && tuple) const |
| DEVICE_INLINE_FUNCTION void | operator() (Args &&... args) const |
Detailed Description
Template parameters:
NDimNumber of arguments takenFUNThe lambda to which we forward the indices
Public Attributes Documentation
variable fun
Public Functions Documentation
function KokkosNDLambdaWrapperReduction
inline TempLat::device_kokkos::KokkosNDLambdaWrapperReduction::KokkosNDLambdaWrapperReduction (
const FUN & _fun
)
function makeArray
template<typename... Args>
inline DEVICE_INLINE_FUNCTION auto TempLat::device_kokkos::KokkosNDLambdaWrapperReduction::makeArray (
device_kokkos::tuple< Args... > && tuple
) const
function operator()
template<typename... Args>
inline DEVICE_INLINE_FUNCTION void TempLat::device_kokkos::KokkosNDLambdaWrapperReduction::operator() (
Args &&... args
) const
The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/parallel/devices/kokkos/kokkos_internal.h