18 template<concepts::Acc T_Acc>
30 template<
typename T_Acc>
42 template<concepts::Acc T_Acc>
54 template<
typename T_Acc>
66 template<concepts::Acc T_Acc>
74 auto blockIdxInGrid = acc.getIdxWithin(onAcc::origin::grid, onAcc::unit::blocks);
75 auto numBlocksInGrid = acc.getExtentsOf(onAcc::origin::grid, onAcc::unit::blocks);
76 auto linearBlockIdx =
linearize(numBlocksInGrid, blockIdxInGrid);
78 std::integral
auto linearNumWarpsInBlock
79 = acc.getExtentsOf(onAcc::origin::block, onAcc::unit::warps).product();
84 template<concepts::Acc T_Acc>
96 template<concepts::Acc T_Acc>
110 using ValueType =
typename ExtentType::type;
111 constexpr uint32_t dim = ExtentType::dim();
117 template<concepts::Acc T_Acc>
130 template<concepts::Acc T_Acc>
142 template<concepts::Acc T_Acc>
150 std::integral
auto linearThreadsInBlock
151 = acc.getExtentsOf(onAcc::origin::block, onAcc::unit::threads).product();
153 return Vec{
divCeil(linearThreadsInBlock,
static_cast<IndexType
>(T_Acc::getWarpSize()))};
157 template<concepts::Acc T_Acc>
169 template<concepts::Acc T_Acc>
177 std::integral
auto linearNumWarpsInBlock
178 = acc.getExtentsOf(onAcc::origin::block, onAcc::unit::warps).product();
179 std::integral
auto linearNumBlocks
180 = acc.getExtentsOf(onAcc::origin::grid, onAcc::unit::blocks).product();
181 return Vec{linearNumBlocks * linearNumWarpsInBlock};
185 template<concepts::Acc T_Acc>
197 template<concepts::Acc T_Acc>
210 using ValueType =
typename ExtentType::type;
211 constexpr uint32_t dim = ExtentType::dim();
#define ALPAKA_TYPEOF(...)
Get the type of instance.
Concept to check if a type is a CVector.
Concept to check if a type is a vector.
constexpr uint32_t getWarpIdx(alpaka::onAcc::concepts::Acc auto const &acc)
Return the warp index within the block.
constexpr uint32_t getLaneIdx(alpaka::onAcc::concepts::Acc auto const &acc)
Return the lane index of the current thread within its warp.
functionality which is usable on the accelerator compute device from within a kernel.
typename GetValueType< T >::type GetValueType_t
ALPAKA_FN_HOST_ACC constexpr auto divCeil(Integral a, Integral b) -> Integral
Returns the ceiling of a / b, as integer.
constexpr T_IntegralType linearize(Vec< T_IntegralType, T_dim - 1u, T_Storage > const &dim, Vec< T_IntegralType, T_dim, T_OtherStorage > const &idx)
Give the linear index of an N-dimensional index within an N-dimensional index space.
Vec< T, sizeof...(T_values), detail::CVec< T, T_values... > > CVec
A vector with compile-time known values.
consteval auto fillCVec()
Create and return a CVector of some length, filled with the given value.
constexpr alpaka::concepts::Vector auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::block), ALPAKA_TYPEOF(unit::threads)) const
constexpr alpaka::concepts::Vector auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::grid), ALPAKA_TYPEOF(unit::threads)) const
constexpr alpaka::concepts::Vector< alpaka::NotRequired, 1u > auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::grid), ALPAKA_TYPEOF(unit::warps)) const
constexpr alpaka::concepts::CVector< uint32_t > auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::warp), ALPAKA_TYPEOF(unit::threads)) const
constexpr alpaka::concepts::Vector auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::grid), ALPAKA_TYPEOF(unit::blocks)) const
constexpr alpaka::concepts::Vector auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::thread), ALPAKA_TYPEOF(unit::threads)) const
The identity of the thread.
constexpr alpaka::concepts::Vector< alpaka::NotRequired, 1u > auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::block), ALPAKA_TYPEOF(unit::warps)) const
constexpr alpaka::concepts::Vector< uint32_t, 1u > auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::warp), ALPAKA_TYPEOF(unit::threads)) const
constexpr alpaka::concepts::Vector auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::grid), ALPAKA_TYPEOF(unit::threads)) const
constexpr alpaka::concepts::Vector< uint32_t, 1u > auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::grid), ALPAKA_TYPEOF(unit::warps)) const
constexpr alpaka::concepts::Vector auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::block), ALPAKA_TYPEOF(unit::threads)) const
constexpr alpaka::concepts::Vector< uint32_t, 1u > auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::block), ALPAKA_TYPEOF(unit::warps)) const
constexpr alpaka::concepts::Vector auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::thread), ALPAKA_TYPEOF(unit::threads)) const
The identity of the thread.
constexpr alpaka::concepts::Vector auto operator()(T_Acc const &acc, ALPAKA_TYPEOF(origin::grid), ALPAKA_TYPEOF(unit::blocks)) const