19 template<
typename T_IndexType, u
int32_t T_dim>
29 static consteval uint32_t
dim()
94 [[nodiscard]]
constexpr explicit operator bool() const noexcept
103 template<concepts::VectorOrScalar T_Extents>
111 typename T_IndexType,
117 template<u
int32_t T_simdW
idth>
118 constexpr auto load(
auto&& linearIdxGenerator, T_MdSpanAlignment alignment, T_Idx
const& idx)
const
120 alpaka::unused(alignment);
122 std::is_same_v<LinearizedIdxGenerator<T_IndexType, T_dim>,
ALPAKA_TYPEOF(linearIdxGenerator)>,
123 "Type of linearIdxGenerator must match the class template signature.");
124 using DataTypeType = std::remove_reference_t<
decltype(linearIdxGenerator[idx])>;
125 using DstType = std::conditional_t<
126 std::is_const_v<DataTypeType>,
134 return linearIdxGenerator[idx + T_Idx::fill(0).rAssign(i)];
#define ALPAKA_FN_HOST_ACC
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.
Concept to check for an alignment object.
Check whether the specified type is a multidimensional index.
Concept to check if a type is a vector or scalar variable.
Concept to check if a type is a vector.
constexpr uint32_t getDim_v
constexpr auto calculatePitchesFromExtents(T_Vec const &extent)
Calculate the pitches purely from the extents.
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.
ALPAKA_FN_HOST_ACC LinearizedIdxGenerator(T_Extents const &) -> LinearizedIdxGenerator< trait::GetValueType_t< T_Extents >, trait::getDim_v< T_Extents > >
Strongly typed and constexpr representation of a byte-alignment of memory.
Generate a linearized scalar index.
constexpr value_type operator[](std::integral auto const &idx)
Get value at the given index.
static consteval uint32_t dim()
constexpr auto getExtents() const
supported index range
constexpr value_type operator[](alpaka::concepts::IndexVec< T_IndexType, T_dim > auto const &idx) const
Get value at the given index.
constexpr LinearizedIdxGenerator(alpaka::concepts::VectorOrScalar auto const &size)
constexpr auto getPitches() const
constexpr value_type operator[](alpaka::concepts::IndexVec< T_IndexType, T_dim > auto const &idx)
Get value at the given index.
constexpr value_type operator[](std::integral auto const &idx) const
Get value at the given index.
static constexpr auto getAlignment()
Get alignment of the generators value_type.