40 template<
typename T,
typename T_ValueType = alpaka::NotRequired, u
int32_t T_w
idth = alpaka::notRequiredW
idth>
42 && (std::same_as<T_ValueType, trait::GetValueType_t<std::decay_t<T>>>
43 || std::same_as<T_ValueType, alpaka::NotRequired>)
64 using IdxType =
typename T_IdxType::UniVec;
66 static consteval uint32_t
width()
68 return T_SimdWidth{}.back();
71 constexpr SimdPtr(T_MdSpan
const& mdSpan, T_IdxType
const& idx, T_MemAlignment, T_SimdWidth)
91 "The dimension of idx must match the encapsulated MdSpan dimension and the index type of idx must be "
92 "lossless castable to the MdSpan index type");
93 constexpr uint32_t valueAlignment =
static_cast<uint32_t
>(
alignof(
value_type));
96 static_cast<T_MdSpan
>(*this),
109 "The dimension of idx must match the encapsulated MdSpan dimension and the index type of idx must be "
110 "lossless castable to the MdSpan index type");
111 constexpr uint32_t valueAlignment =
static_cast<uint32_t
>(
alignof(
value_type));
114 static_cast<T_MdSpan
>(*this),
122 constexpr decltype(
auto)
load()
const
127 constexpr decltype(
auto)
load()
141 using SpanElemType =
typename T_MdSpan::value_type;
142 constexpr uint32_t spanAlignment = T_MdSpan::getAlignment().template
get<SpanElemType>();
143 using MemoryAlignment = std::conditional_t<
144 std::is_same_v<AutoAligned, T_MemAlignment>,
147 return MemoryAlignment{};
156 template<
typename T_Storage>
159 auto* ptr = &T_MdSpan::operator[](
m_idx);
164 template<
typename T_Storage>
167 auto* ptr = &T_MdSpan::operator[](
m_idx);
171 template<
typename T_Storage>
178 template<
typename T_Storage>
210 template<u
int32_t T_simdW
idth>
211 constexpr auto load(
auto&& dataSource, T_MdSpanAlignment alignment, T_Idx
const& idx)
const
215 "Data source type must match the class template signature.");
216 auto&& d = dataSource[idx];
217 using DataTypeType = std::remove_reference_t<
decltype(d)>;
218 using DstType = std::conditional_t<
219 std::is_const_v<DataTypeType>,
224 dest.copyFrom(&d, alignment);
#define ALPAKA_TYPEOF(...)
Get the type of instance.
Concept to check for an alignment object.
Concept to check if a type is a CVector.
Interface concept for objects describing multidimensional memory access.
Check whether the specified type is a multidimensional index.
Concept to check if a type is a SIMD pointer.
Concept to check if a type is a vector.
alpaka internal implementations.
constexpr auto loadAsSimd(auto &&anyDataSource, auto dataAlignment, auto const &index)
Get data as SIMD vector.
constexpr bool isSimdPtr_v
constexpr uint32_t notRequiredWidth
constexpr bool isSpecializationOf_v
checks if T is a instance of U
constexpr decltype(auto) get(concepts::SpecializationOf< Dict > auto &t) noexcept
Strongly typed and constexpr representation of a byte-alignment of memory.
constexpr SimdPtr & operator=(Simd< value_type, SimdPtr::width(), T_Storage > const &rhs)
store the simd pack to the memory the pointer is pointing to
static consteval uint32_t width()
static constexpr auto getAlignment()
get the alignment of the memory the pointer is pointing to
constexpr void storeTo(Simd< value_type, SimdPtr::width(), T_Storage > const &rhs)
store the simd pack to the memory the pointer is pointing to
constexpr void storeTo(Simd< value_type, SimdPtr::width(), T_Storage > const &rhs) const
store the simd pack to the memory the pointer is pointing to
constexpr IdxType getIdx() const
offset in elements relative to the MdSpan given at construction
typename T_MdSpan::value_type value_type
constexpr SimdPtr(T_MdSpan const &mdSpan, T_IdxType const &idx, T_MemAlignment, T_SimdWidth)
constexpr alpaka::concepts::SimdPtr auto operator[](auto const &idx)
Shift the element the pointer is pointing to by idx.
typename T_IdxType::UniVec IdxType
constexpr decltype(auto) load()
constexpr decltype(auto) load() const
constexpr SimdPtr const & operator=(Simd< value_type, SimdPtr::width(), T_Storage > const &rhs) const
store the simd pack to the memory the pointer is pointing to
constexpr alpaka::concepts::SimdPtr auto operator[](auto const &idx) const
Shift the element the pointer is pointing to by idx.
constexpr auto load(auto &&dataSource, T_MdSpanAlignment alignment, T_Idx const &idx) const