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);
81 template<concepts::Acc T_Acc>
93 template<concepts::Acc T_Acc>
107 using ValueType =
typename ExtentType::type;
108 constexpr uint32_t dim = ExtentType::dim();
114 template<concepts::Acc T_Acc>
127 template<concepts::Acc T_Acc>
139 template<concepts::Acc T_Acc>
147 std::integral
auto linearThreadsInBlock
148 = acc.getExtentsOf(onAcc::origin::block, onAcc::unit::threads).product();
150 return Vec{
divCeil(linearThreadsInBlock,
static_cast<IndexType
>(T_Acc::getWarpSize()))};
154 template<concepts::Acc T_Acc>
166 template<concepts::Acc T_Acc>
174 std::integral
auto linearNumWarpsInBlock
175 = acc.getExtentsOf(onAcc::origin::block, onAcc::unit::warps).product();
176 std::integral
auto linearNumBlocks
177 = acc.getExtentsOf(onAcc::origin::grid, onAcc::unit::blocks).product();
178 return Vec{linearNumBlocks * linearNumWarpsInBlock};
182 template<concepts::Acc T_Acc>
194 template<concepts::Acc T_Acc>
207 using ValueType =
typename ExtentType::type;
208 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