![]() |
alpaka
Abstraction Library for Parallel Kernel Acceleration
|
Lightweight view to data in an n-dimensional array. More...
#include <MdSpan.hpp>
Public Types | |
| using | const_pointer = std::add_const_t<value_type>* |
| using | const_reference = std::add_const_t<value_type>& |
| using | ConstThis = MdSpan<std::add_const_t<value_type>, T_Extents, T_Pitches, T_MemAlignment> |
| using | index_type = typename T_Pitches::type |
| using | pointer = value_type* |
| using | reference = value_type& |
| using | value_type = T_Type |
Public Member Functions | |
| constexpr | MdSpan ()=default |
| constexpr | MdSpan (MdSpan &&)=default |
| constexpr | MdSpan (MdSpan const &)=default |
| template<typename T_Type_Other> | |
| constexpr | MdSpan (MdSpan< T_Type_Other, T_Extents, T_Pitches, T_MemAlignment > &&other) |
| template<typename T_Type_Other> | |
| constexpr | MdSpan (MdSpan< T_Type_Other, T_Extents, T_Pitches, T_MemAlignment > const &other) |
| constexpr | MdSpan (T_Type *pointer, T_Extents extents, T_Pitches const &pitchBytes, T_MemAlignment const &memAlignmentInByte=T_MemAlignment{}) |
| Constructor. | |
| constexpr auto | begin () |
| constexpr auto | begin () const |
| constexpr auto | cbegin () const |
| constexpr auto | cend () const |
| constexpr pointer | data () |
| constexpr const_pointer | data () const |
| get origin pointer | |
| constexpr auto | end () |
| constexpr auto | end () const |
| constexpr auto | getConstMdSpan () const |
| constexpr auto | getExtents () const |
| constexpr T_Pitches | getPitches () const |
| constexpr | operator bool () const noexcept |
| True if MdSpan is pointing to valid memory. | |
| constexpr reference | operator* () |
| constexpr const_reference | operator* () const |
| return value the origin pointer is pointing to | |
| constexpr MdSpan & | operator= (MdSpan &&)=default |
| constexpr MdSpan & | operator= (MdSpan const &)=default |
| Assignment operator keeping const-ness. | |
| constexpr reference | operator[] (concepts::IndexVec< index_type, alpaka::trait::GetDim< T_Extents >::value > auto const &idx) |
| constexpr const_reference | operator[] (concepts::IndexVec< index_type, alpaka::trait::GetDim< T_Extents >::value > auto const &idx) const |
| get value at the given index | |
| constexpr reference | operator[] (std::integral auto const &idx) |
| constexpr const_reference | operator[] (std::integral auto const &idx) const |
Static Public Member Functions | |
| static consteval uint32_t | dim () |
| static constexpr auto | getAlignment () |
Protected Member Functions | |
| constexpr pointer | ptr (concepts::Vector auto const &idx) |
| constexpr const_pointer | ptr (concepts::Vector auto const &idx) const |
| constexpr auto | ptr (concepts::Vector auto const &idx) const |
| get the pointer of the value relative to the origin pointer m_ptr | |
Lightweight view to data in an n-dimensional array.
Const-ness of the MdSpan instance is propagated to the data region. A constant MdSpan can be used to access non-const data.
| T_Type | if the type is const the data is only readable |
Definition at line 67 of file MdSpan.hpp.
| using alpaka::MdSpan< T_Type, T_Extents, T_Pitches, T_MemAlignment >::const_pointer = std::add_const_t<value_type>* |
Definition at line 73 of file MdSpan.hpp.
| using alpaka::MdSpan< T_Type, T_Extents, T_Pitches, T_MemAlignment >::const_reference = std::add_const_t<value_type>& |
Definition at line 71 of file MdSpan.hpp.
| using alpaka::MdSpan< T_Type, T_Extents, T_Pitches, T_MemAlignment >::ConstThis = MdSpan<std::add_const_t<value_type>, T_Extents, T_Pitches, T_MemAlignment> |
Definition at line 76 of file MdSpan.hpp.
| using alpaka::MdSpan< T_Type, T_Extents, T_Pitches, T_MemAlignment >::index_type = typename T_Pitches::type |
Definition at line 74 of file MdSpan.hpp.
| using alpaka::MdSpan< T_Type, T_Extents, T_Pitches, T_MemAlignment >::pointer = value_type* |
Definition at line 72 of file MdSpan.hpp.
| using alpaka::MdSpan< T_Type, T_Extents, T_Pitches, T_MemAlignment >::reference = value_type& |
Definition at line 70 of file MdSpan.hpp.
| using alpaka::MdSpan< T_Type, T_Extents, T_Pitches, T_MemAlignment >::value_type = T_Type |
Definition at line 69 of file MdSpan.hpp.
|
constexprdefault |
|
inlineconstexpr |
Constructor.
| pointer | pointer to the memory |
| extents | number of elements |
| pitchBytes | pitch in bytes per dimension |
| memAlignmentInByte | alignment in bytes (zero will set alignment to element alignment) |
Definition at line 154 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 167 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 176 of file MdSpan.hpp.
|
constexprdefault |
|
constexprdefault |
|
inlineconstexpr |
Definition at line 119 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 114 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 134 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 139 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 109 of file MdSpan.hpp.
|
inlineconstexpr |
get origin pointer
If the pointer is const and therefore read only depends on T_Type and not the const-ness of MdSPan.
Definition at line 104 of file MdSpan.hpp.
|
inlinestaticconsteval |
Definition at line 81 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 129 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 124 of file MdSpan.hpp.
|
inlinestaticconstexpr |
Definition at line 194 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 238 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 228 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 233 of file MdSpan.hpp.
|
inlineexplicitnodiscardconstexprnoexcept |
True if MdSpan is pointing to valid memory.
An MdSpan remains valid even after being moved. The reason for this is that the MdSpan is simply copied. This is more efficient than a real move (e.g., setting the data pointer to nullptr). Implementing a real move is also not possible because MdSpan must be trivially copyable, which requires a default move constructor.
Definition at line 256 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 95 of file MdSpan.hpp.
|
inlineconstexpr |
return value the origin pointer is pointing to
Definition at line 90 of file MdSpan.hpp.
|
constexprdefault |
|
constexprdefault |
Assignment operator keeping const-ness.
|
inlineconstexpr |
Definition at line 211 of file MdSpan.hpp.
|
inlineconstexpr |
get value at the given index
| idx | n-dimensional offset, relative to the origin pointer |
Definition at line 204 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 223 of file MdSpan.hpp.
|
inlineconstexpr |
Definition at line 218 of file MdSpan.hpp.
|
inlineconstexprprotected |
Definition at line 289 of file MdSpan.hpp.
|
inlineconstexprprotected |
Definition at line 284 of file MdSpan.hpp.
|
inlineconstexprprotected |
get the pointer of the value relative to the origin pointer m_ptr
| idx | n-dimensional offset |
offset in bytes
We calculate the complete offset in bytes even if it would be possible to change the x-dimension with the native value_types pointer, this is reducing the register footprint.
Definition at line 267 of file MdSpan.hpp.