alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
alpaka::KernelBundle< TKernelFn, TArgs > Class Template Reference

The class used to bind kernel function object and arguments together. Once an instance of this class is created, arguments are not needed to be separately given to functions who need kernel function and arguments. More...

#include <KernelBundle.hpp>

Public Types

using ArgTuple
 Tuple type to encapsulate kernel function argument types and argument values.
using KernelFn = std::decay_t<TKernelFn>
 The function object type.

Public Member Functions

constexpr KernelBundle (KernelBundle const &b)=default
constexpr KernelBundle (KernelFn const &kernelFn)
constexpr KernelBundle (KernelFn const &kernelFn, auto &&... args)
template<typename TAcc>
constexpr auto operator() (TAcc const &acc) const
constexpr KernelBundleoperator= (KernelBundle const &)=default
constexpr KernelBundle (KernelBundle &&b)=default
 allow move assignment and constriction
constexpr KernelBundleoperator= (KernelBundle &&)=default
 allow move assignment and constriction

Public Attributes

ArgTuple m_args
KernelFn m_kernelFn

Detailed Description

template<typename TKernelFn, typename... TArgs>
class alpaka::KernelBundle< TKernelFn, TArgs >

The class used to bind kernel function object and arguments together. Once an instance of this class is created, arguments are not needed to be separately given to functions who need kernel function and arguments.

Template Parameters
TKernelFnThe kernel function object type.
TArgsKernel function object invocation argument types as a parameter pack.

Definition at line 58 of file KernelBundle.hpp.

Member Typedef Documentation

◆ ArgTuple

template<typename TKernelFn, typename... TArgs>
using alpaka::KernelBundle< TKernelFn, TArgs >::ArgTuple
Initial value:
std::conditional_t<
sizeof...(TArgs) == 0,
std::tuple<>,
#define ALPAKA_TYPEOF(...)
Get the type of instance.
Definition common.hpp:154
decltype(auto) makeAccessibleOnAcc(auto &&any)
Provides an instance of an object which can be used within the compute kernel.
typename remove_restrict< T >::type remove_restrict_t
Helper to remove restrict from a type.
basic tuple implementation
Definition Tuple.hpp:52

Tuple type to encapsulate kernel function argument types and argument values.

Definition at line 64 of file KernelBundle.hpp.

◆ KernelFn

template<typename TKernelFn, typename... TArgs>
using alpaka::KernelBundle< TKernelFn, TArgs >::KernelFn = std::decay_t<TKernelFn>

The function object type.

Definition at line 62 of file KernelBundle.hpp.

Constructor & Destructor Documentation

◆ KernelBundle() [1/4]

template<typename TKernelFn, typename... TArgs>
alpaka::KernelBundle< TKernelFn, TArgs >::KernelBundle ( KernelFn const & kernelFn)
inlineconstexpr

Definition at line 70 of file KernelBundle.hpp.

◆ KernelBundle() [2/4]

template<typename TKernelFn, typename... TArgs>
alpaka::KernelBundle< TKernelFn, TArgs >::KernelBundle ( KernelFn const & kernelFn,
auto &&... args )
inlineconstexpr

Definition at line 78 of file KernelBundle.hpp.

◆ KernelBundle() [3/4]

template<typename TKernelFn, typename... TArgs>
alpaka::KernelBundle< TKernelFn, TArgs >::KernelBundle ( KernelBundle< TKernelFn, TArgs > const & b)
constexprdefault

◆ KernelBundle() [4/4]

template<typename TKernelFn, typename... TArgs>
alpaka::KernelBundle< TKernelFn, TArgs >::KernelBundle ( KernelBundle< TKernelFn, TArgs > && b)
constexprdefault

allow move assignment and constriction

Attention
if the functor or the arguments contains non movable types the move operators can be inaccessible.

Member Function Documentation

◆ operator()()

template<typename TKernelFn, typename... TArgs>
template<typename TAcc>
auto alpaka::KernelBundle< TKernelFn, TArgs >::operator() ( TAcc const & acc) const
inlineconstexpr

Definition at line 115 of file KernelBundle.hpp.

◆ operator=() [1/2]

template<typename TKernelFn, typename... TArgs>
KernelBundle & alpaka::KernelBundle< TKernelFn, TArgs >::operator= ( KernelBundle< TKernelFn, TArgs > && )
constexprdefault

allow move assignment and constriction

Attention
if the functor or the arguments contains non movable types the move operators can be inaccessible.

◆ operator=() [2/2]

template<typename TKernelFn, typename... TArgs>
KernelBundle & alpaka::KernelBundle< TKernelFn, TArgs >::operator= ( KernelBundle< TKernelFn, TArgs > const & )
constexprdefault

Member Data Documentation

◆ m_args

template<typename TKernelFn, typename... TArgs>
ArgTuple alpaka::KernelBundle< TKernelFn, TArgs >::m_args

Definition at line 143 of file KernelBundle.hpp.

◆ m_kernelFn

template<typename TKernelFn, typename... TArgs>
KernelFn alpaka::KernelBundle< TKernelFn, TArgs >::m_kernelFn

Definition at line 141 of file KernelBundle.hpp.


The documentation for this class was generated from the following file: