Base class for multi-dimensional views. More...
Public Types | |
| using | value_type = DataType |
| using | ExtentsType = Extents |
| using | LayoutPolicyType = LayoutPolicy |
| using | MDIndexType = typename Extents::MDIndexType |
| using | LoopIndexType = MDIndexType |
| using | ArrayExtentsWithOffsetType = ArrayExtentsWithOffset<Extents, LayoutPolicy> |
| using | DynamicDimsType = typename Extents::DynamicDimsType |
| using | RemovedFirstExtentsType = typename Extents::RemovedFirstExtentsType |
| using | ArrayBoundsIndexType = typename Extents::MDIndexType |
| using | IndexType = typename Extents::MDIndexType |
Public Member Functions | |
| constexpr __host__ __device__ | MDSpan (DataType *ptr, ArrayExtentsWithOffsetType extents) |
| constexpr __host__ __device__ | MDSpan (DataType *ptr, const DynamicDimsType &dims) |
| template<typename X, typename = std::enable_if_t<std::is_same_v<X, UnqualifiedValueType>>> | |
| constexpr __host__ __device__ | MDSpan (const MDSpan< X, Extents > &rhs) |
| constexpr __host__ __device__ | MDSpan (SmallSpan< DataType > v) |
| constexpr __host__ __device__ | MDSpan (SmallSpan< const DataType > v) |
| constexpr __host__ __device__ ThatClass & | operator= (SmallSpan< DataType > v) |
| constexpr __host__ __device__ ThatClass & | operator= (SmallSpan< const DataType > v) |
| constexpr __host__ __device__ DataType * | _internalData () |
| constexpr __host__ __device__ const DataType * | _internalData () const |
| ArrayExtents< Extents > | extents () const |
| ArrayExtentsWithOffsetType | extentsWithOffset () const |
| constexpr __host__ __device__ Int32 | extent0 () const |
| Value of the first dimension. | |
| constexpr __host__ __device__ Int32 | extent1 () const |
| Value of the second dimension. | |
| constexpr __host__ __device__ Int32 | extent2 () const |
| Value of the third dimension. | |
| constexpr __host__ __device__ Int32 | extent3 () const |
| Value of the fourth dimension. | |
| constexpr __host__ __device__ Int64 | offset (Int32 i, Int32 j, Int32 k, Int32 l) const |
| Value for element i,j,k,l. | |
| constexpr __host__ __device__ Int64 | offset (Int32 i, Int32 j, Int32 k) const |
| Value for element i,j,k. | |
| constexpr __host__ __device__ Int64 | offset (Int32 i, Int32 j) const |
| Value for element i,j. | |
| constexpr __host__ __device__ Int64 | offset (Int32 i) const |
| Value for element i. | |
| constexpr __host__ __device__ Int64 | offset (MDIndexType idx) const |
| Value for element idx. | |
| constexpr __host__ __device__ DataType & | operator() (Int32 i, Int32 j, Int32 k, Int32 l) const |
| Value for element i,j,k,l. | |
| __host__ __device__ DataType & | operator() (Int32 i, Int32 j, Int32 k) const |
| Value for element i,j,k. | |
| constexpr __host__ __device__ DataType & | operator() (Int32 i, Int32 j) const |
| Value for element i,j. | |
| constexpr __host__ __device__ DataType & | operator() (Int32 i) const |
| Value for element i. | |
| constexpr __host__ __device__ DataType | operator[] (Int32 i) const |
| Value for element i. | |
| constexpr __host__ __device__ DataType & | operator() (MDIndexType idx) const |
| Value for element idx. | |
| constexpr __host__ __device__ DataType * | ptrAt (Int32 i, Int32 j, Int32 k, Int32 l) const |
| Pointer to the value for element i,j,k,l. | |
| __host__ __device__ DataType * | ptrAt (Int32 i, Int32 j, Int32 k) const |
| Pointer to the value for element i,j,k. | |
| constexpr __host__ __device__ DataType * | ptrAt (Int32 i, Int32 j) const |
| Pointer to the value for element i,j. | |
| constexpr __host__ __device__ DataType * | ptrAt (Int32 i) const |
| Pointer to the value for element i. | |
| constexpr __host__ __device__ DataType * | ptrAt (MDIndexType idx) const |
| Pointer to the value for element i. | |
| __host__ __device__ MDSpan< DataType, RemovedFirstExtentsType, LayoutPolicy > | slice (Int32 i) const |
| Returns a dimension (N-1) view starting from index element i. | |
| constexpr __host__ __device__ MDSpan< const DataType, Extents, LayoutPolicy > | constSpan () const |
| constexpr __host__ __device__ MDSpan< const DataType, Extents, LayoutPolicy > | constMDSpan () const |
| constexpr __host__ __device__ Span< DataType > | to1DSpan () const |
| constexpr SmallSpan< DataType > | to1DSmallSpan () |
| constexpr SmallSpan< const DataType > | to1DSmallSpan () const |
| constexpr SmallSpan< const DataType > | to1DConstSmallSpan () const |
Private Types | |
| using | UnqualifiedValueType = std::remove_cv_t<DataType> |
| using | ThatClass = MDSpan<DataType, Extents, LayoutPolicy> |
Private Attributes | |
| DataType * | m_ptr = nullptr |
| ArrayExtentsWithOffsetType | m_extents |
Static Private Attributes | |
| static constexpr bool | IsConst = std::is_const_v<DataType> |
Friends | |
| class | NumArray< UnqualifiedValueType, Extents, LayoutPolicy > |
| class | MDSpan< const UnqualifiedValueType, Extents, LayoutPolicy > |
Base class for multi-dimensional views.
This class is inspired by the std::mdspan class currently being defined (see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0009r12.html)
This class is used to manage views on arrays such as NumArray. The methods of this class are accessible on the accelerator.
For more information, refer to the page arcanedoc_core_types_numarray.
Definition at line 43 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::ArrayBoundsIndexType = typename Extents::MDIndexType |
Definition at line 64 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::ArrayExtentsWithOffsetType = ArrayExtentsWithOffset<Extents, LayoutPolicy> |
Definition at line 59 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::DynamicDimsType = typename Extents::DynamicDimsType |
Definition at line 60 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::ExtentsType = Extents |
Definition at line 55 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::IndexType = typename Extents::MDIndexType |
Definition at line 65 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::LayoutPolicyType = LayoutPolicy |
Definition at line 56 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::LoopIndexType = MDIndexType |
Definition at line 58 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::MDIndexType = typename Extents::MDIndexType |
Definition at line 57 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::RemovedFirstExtentsType = typename Extents::RemovedFirstExtentsType |
Definition at line 61 of file arccore/src/base/arccore/base/MDSpan.h.
|
private |
Definition at line 49 of file arccore/src/base/arccore/base/MDSpan.h.
|
private |
Definition at line 45 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::value_type = DataType |
Definition at line 54 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 70 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 75 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 81 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 85 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 89 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 108 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 109 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 244 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 239 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value of the first dimension.
Definition at line 125 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value of the second dimension.
Definition at line 127 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value of the third dimension.
Definition at line 129 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value of the fourth dimension.
Definition at line 131 of file arccore/src/base/arccore/base/MDSpan.h.
|
inline |
Definition at line 113 of file arccore/src/base/arccore/base/MDSpan.h.
|
inline |
Definition at line 117 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i.
Definition at line 151 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j.
Definition at line 146 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k.
Definition at line 141 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k,l.
Definition at line 136 of file arccore/src/base/arccore/base/MDSpan.h.
Referenced by Arcane::MDSpan< DataType, Extents, RightLayout >::operator()(), Arcane::MDSpan< DataType, Extents, RightLayout >::operator()(), Arcane::MDSpan< DataType, Extents, RightLayout >::operator()(), Arcane::MDSpan< DataType, Extents, RightLayout >::operator()(), Arcane::MDSpan< DataType, Extents, RightLayout >::operator()(), Arcane::MDSpan< DataType, Extents, RightLayout >::operator[](), Arcane::MDSpan< DataType, Extents, RightLayout >::ptrAt(), Arcane::MDSpan< DataType, Extents, RightLayout >::ptrAt(), Arcane::MDSpan< DataType, Extents, RightLayout >::ptrAt(), Arcane::MDSpan< DataType, Extents, RightLayout >::ptrAt(), and Arcane::MDSpan< DataType, Extents, RightLayout >::ptrAt().
|
inlineconstexpr |
Value for element idx.
Definition at line 154 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i.
Definition at line 177 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j.
Definition at line 172 of file arccore/src/base/arccore/base/MDSpan.h.
|
inline |
Value for element i,j,k.
Definition at line 167 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k,l.
Definition at line 162 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element idx.
Definition at line 182 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 99 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 93 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i.
Definition at line 179 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i.
Definition at line 205 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i,j.
Definition at line 200 of file arccore/src/base/arccore/base/MDSpan.h.
|
inline |
Pointer to the value for element i,j,k.
Definition at line 195 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i,j,k,l.
Definition at line 190 of file arccore/src/base/arccore/base/MDSpan.h.
Referenced by Arcane::MDSpan< DataType, Extents, RightLayout >::slice().
|
inlineconstexpr |
Pointer to the value for element i.
Definition at line 208 of file arccore/src/base/arccore/base/MDSpan.h.
|
inline |
Returns a dimension (N-1) view starting from index element i.
For example:
Definition at line 228 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 262 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 254 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 258 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 249 of file arccore/src/base/arccore/base/MDSpan.h.
|
friend |
Definition at line 1 of file arccore/src/base/arccore/base/MDSpan.h.
|
friend |
Definition at line 1 of file arccore/src/base/arccore/base/MDSpan.h.
|
staticconstexprprivate |
Definition at line 50 of file arccore/src/base/arccore/base/MDSpan.h.
|
private |
Definition at line 270 of file arccore/src/base/arccore/base/MDSpan.h.
|
private |
Definition at line 269 of file arccore/src/base/arccore/base/MDSpan.h.