30 template<
typename TAcc,
typename TExtent,
typename TPitch>
33 std::uint8_t
const val,
36 TPitch pitch)
const ->
void
39 auto const gridThreadIdx(alpaka::getIdx<alpaka::Grid, alpaka::Threads>(acc));
40 auto const threadElemExtent(alpaka::getWorkDiv<alpaka::Thread, alpaka::Elems>(acc));
42 auto idx = mapIdxPitchBytes<1u, Dim<TAcc>::value>(idxThreadFirstElem, pitch)[0];
44 auto const lastIdx = idx
46 threadElemExtent[lastDim],
47 static_cast<Idx>(extent[lastDim] - idxThreadFirstElem[lastDim]));
49 if((idxThreadFirstElem < extent).foldrAll(std::logical_and<bool>()))
51 for(; idx < lastIdx; ++idx)
any device ND memory set kernel.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_ACC auto operator()(TAcc const &acc, std::uint8_t const val, std::uint8_t *dst, TExtent extent, TPitch pitch) const -> void
The kernel entry point.
#define ALPAKA_FN_ACC
All functions that can be used on an accelerator have to be attributed with ALPAKA_FN_ACC or ALPAKA_F...
#define ALPAKA_NO_HOST_ACC_WARNING
Disable nvcc warning: 'calling a host function from host device function.' Usage: ALPAKA_NO_HOST_ACC_...
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto min(T const &min_ctx, Tx const &x, Ty const &y)
Returns the smaller of two arguments. NaNs are treated as missing data (between a NaN and a numeric v...
The alpaka accelerator library.
typename trait::IdxType< T >::type Idx
typename trait::DimType< T >::type Dim
The dimension type trait alias template to remove the ::type.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getIdxThreadFirstElem([[maybe_unused]] TIdxWorkDiv const &idxWorkDiv, TGridThreadIdx const &gridThreadIdx, TThreadElemExtent const &threadElemExtent) -> Vec< Dim< TIdxWorkDiv >, Idx< TIdxWorkDiv >>
Get the index of the first element this thread computes.