25 template<
typename T_Any>
57 template<
typename TKernelFn,
typename... TArgs>
65 sizeof...(TArgs) == 0,
74 "Kernel functor must be trivially copyable or specialize trait::IsKernelTriviallyCopyable<>!");
84 "Kernel functor must be trivially copyable or specialize trait::IsKernelTriviallyCopyable<>!");
89 "All kernel arguments must be trivially copyable or specialize "
90 "trait::IsKernelArgumentTriviallyCopyable<>!");
108 template<
typename TAcc>
111 && std::is_invocable_v<
112 std::remove_const_t<KernelFn>,
115 constexpr auto operator()(TAcc
const& acc)
const
119 std::add_const_t<KernelFn>,
122 "the operator() function of a kernel must be marked const");
126 std::invoke_result_t<
127 std::add_const_t<KernelFn>,
130 "the return type of the operator() function of a kernel must be void");
154 template<
typename TKernelFn,
typename... TArgs>
160 struct IsKernelBundle : std::integral_constant<bool, isSpecializationOf_v<T, KernelBundle>>
The class used to bind kernel function object and arguments together. Once an instance of this class ...
std::conditional_t< sizeof...(TArgs)==0, std::tuple<>, alpaka::Tuple< remove_restrict_t< ALPAKA_TYPEOF(onHost::makeAccessibleOnAcc(std::declval< TArgs >()))>... > > ArgTuple
Tuple type to encapsulate kernel function argument types and argument values.
constexpr KernelBundle(KernelBundle &&b)=default
allow move assignment and constriction
constexpr KernelBundle & operator=(KernelBundle &&)=default
allow move assignment and constriction
constexpr KernelBundle(KernelFn const &kernelFn, auto &&... args)
constexpr KernelBundle(KernelFn const &kernelFn)
constexpr KernelBundle(KernelBundle const &b)=default
std::decay_t< TKernelFn > KernelFn
The function object type.
constexpr KernelBundle & operator=(KernelBundle const &)=default
#define ALPAKA_FN_HOST
All functions that can be used on an accelerator have to be attributed with ALPAKA_FN_ACC or ALPAKA_F...
#define ALPAKA_TYPEOF(...)
Get the type of instance.
#define ALPAKA_FORWARD(instance)
Perfectly forward an instance as argument.
Concept to check for a kernel argument object.
Concept to check if a type is a KernelBundle.
Concept to check for a kernel function object.
Functionality which is usable on the host CPU controller thread.
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.
ALPAKA_FN_HOST KernelBundle(TKernelFn const &, TArgs &&...) -> KernelBundle< TKernelFn, TArgs... >
User defined deduction guide with trailing return type. For CTAD during the construction.
constexpr bool isKernelBundle_v
ALPAKA_FN_INLINE constexpr decltype(auto) apply(T_Func &&func, T_TupleLike &&tuple)
Applies a function to the elements of a tuple-like object.
basic tuple implementation
auto & operator()(auto &any) const
auto const & operator()(auto const &any) const
Provides an instance of an object which can be used within the compute kernel.