33 template<
typename T_Type, u
int32_t T_dim>
37 :
Vec<T_Type, T_dim - 1u>{first.template
rshrink<T_dim - 1u>()}
41 constexpr decltype(
auto)
operator[](T_Type idx)
const
46 constexpr decltype(
auto)
operator[](T_Type idx)
52 template<
typename T_Type>
63 typename T_ThreadSpace,
64 typename T_IdxMapperFn,
70 static_assert(std::ranges::forward_range<TiledIdxContainer>);
71 static_assert(std::ranges::borrowed_range<TiledIdxContainer>);
72 static_assert(std::ranges::range<TiledIdxContainer>);
73 static_assert(std::ranges::input_range<TiledIdxContainer>);
77 using IdxType =
typename T_IdxRange::IdxType;
78 static constexpr uint32_t
dim = T_IdxRange::dim();
82 T_IdxRange
const& idxRange,
83 T_ThreadSpace
const& threadSpace,
84 T_IdxMapperFn idxMapping,
85 T_CSelect
const& = T_CSelect{})
89 alpaka::unused(idxMapping);
108 static_assert(std::forward_iterator<const_iterator_end>);
129 return !(*
this == other);
139 return !(*
this == other);
151 static constexpr uint32_t
iterDim = T_CSelect::dim();
156 static_assert(std::forward_iterator<const_iterator>);
157 static_assert(std::input_iterator<const_iterator>);
167 ,
m_extent{(extent + offset)[T_CSelect{}]}
174 bool isIndexValid =
true;
175 for(uint32_t d = 1u; d <
iterDim; ++d)
198 for(uint32_t d = 0; d <
iterDim; ++d)
200 uint32_t
const idx =
iterDim - 1u - d;
230 return !(*
this == other);
240 return !(*
this == other);
254 constexpr auto selectedDims = T_CSelect{};
255 auto [threadIdx, numThreads] =
m_threadSpace.mapTo(selectedDims);
257 if constexpr(std::is_same_v<T_IdxMapperFn, layout::Strided>)
265 else if constexpr(std::is_same_v<T_IdxMapperFn, layout::Contiguous>)
275 IdxVecType firstLogical = threadIdx * base + threadIdx.
min(rem);
279 IdxVecType endLogical = nextThreadIdx * base + nextThreadIdx.
min(rem);
289 constexpr auto selectedDims = T_CSelect{};
290 auto [threadIdx, numThreads] =
m_threadSpace.mapTo(selectedDims);
292 if constexpr(std::is_same_v<T_IdxMapperFn, layout::Strided>)
296 else if constexpr(std::is_same_v<T_IdxMapperFn, layout::Contiguous>)
307 IdxVecType endLogical = nextSlotIdx * base + nextSlotIdx.
min(rem);
special implementation to define the end
constexpr bool operator!=(const_iterator_end const &other) const
constexpr bool operator==(const_iterator const &other) const
friend class TiledIdxContainer
constexpr bool operator==(const_iterator_end const &other) const
ALPAKA_FN_ACC const_iterator_end(alpaka::concepts::Vector auto const &extent)
constexpr IdxType operator*() const
constexpr bool operator!=(const_iterator const &other) const
ALPAKA_FN_ACC constexpr IdxType slowCurrent() const
constexpr bool operator==(const_iterator_end const &other) const
ALPAKA_FN_ACC const_iterator operator++(int)
detail::ReducedVector< IdxType, iterDim > m_first
Vec< IdxType, iterDim > IterIdxVecType
constexpr bool operator!=(const_iterator_end const &other) const
constexpr bool operator!=(const_iterator const &other) const
constexpr bool operator==(const_iterator const &other) const
ALPAKA_FN_ACC const_iterator & operator++()
friend class TiledIdxContainer
static constexpr uint32_t iterDim
constexpr const_iterator(alpaka::concepts::Vector auto const offset, alpaka::concepts::Vector auto const first, alpaka::concepts::Vector auto const extent, alpaka::concepts::Vector auto const stride)
constexpr IdxVecType operator*() const
friend class const_iterator_end
ALPAKA_FN_ACC const_iterator begin() const
constexpr TiledIdxContainer(TiledIdxContainer &&)=default
T_ThreadSpace m_threadSpace
Vec< IdxType, dim > IdxVecType
static constexpr uint32_t dim
ALPAKA_FN_ACC TiledIdxContainer(T_IdxRange const &idxRange, T_ThreadSpace const &threadSpace, T_IdxMapperFn idxMapping, T_CSelect const &=T_CSelect{})
ALPAKA_FN_ACC const_iterator_end end() const
typename T_IdxRange::IdxType IdxType
ALPAKA_FN_HOST_ACC constexpr auto operator[](alpaka::concepts::CVector auto const iterDir) const
constexpr TiledIdxContainer(TiledIdxContainer const &)=default
#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_FN_HOST_ACC
All functions that can be used on an accelerator have to be attributed with ALPAKA_FN_ACC or ALPAKA_F...
Concept to check if a type is a CVector.
Concept to check if a type is an index range.
Concept to check if a type is a vector.
functionality which is usable on the accelerator compute device from within a kernel.
ALPAKA_FN_HOST_ACC constexpr auto divCeil(Integral a, Integral b) -> Integral
Returns the ceiling of a / b, as integer.
constexpr auto min(Vec< T_Type, T_dim, T_OtherStorage > const &rhs) const
constexpr Vec< T_Type, T_numElements > rshrink() const
constexpr decltype(auto) operator[](std::integral auto const idx)
constexpr ReducedVector(Vec< T_Type, 1u > const &)
constexpr ReducedVector(Vec< T_Type, T_dim > const &first)