KokkosNDLambdaWrapper< dim, FUN > Struct Template Reference#
|
DiFfRG
|
This is a functor which wraps a lambda. 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 KokkosNDLambdaWrapper 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.hh>
Public Member Functions | |
| KOKKOS_FUNCTION | KokkosNDLambdaWrapper (const FUN &_fun) |
| template<typename... Args> requires (sizeof...(Args) == dim) | |
| KOKKOS_FORCEINLINE_FUNCTION void | operator() (Args &&...args) const |
Public Attributes | |
| FUN | fun |
Detailed Description
struct DiFfRG::KokkosNDLambdaWrapper< dim, FUN >
This is a functor which wraps a lambda. 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 KokkosNDLambdaWrapper 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.
- Template Parameters
-
dim Number of arguments taken FUN The lambda to which we forward the indices
Constructor & Destructor Documentation
◆ KokkosNDLambdaWrapper()
|
inline |
Member Function Documentation
◆ operator()()
requires (sizeof...(Args) == dim)
|
inline |
Member Data Documentation
◆ fun
| FUN DiFfRG::KokkosNDLambdaWrapper< dim, FUN >::fun |
The documentation for this struct was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/common/kokkos.hh
Generated by