Base class for multidimensional views. More...
Public Types | |
| using | DataType = DataType_ |
| using | Extents = Extents_ |
| using | LayoutPolicy = LayoutPolicy_ |
| using | value_type = DataType |
| using | ExtentsType = Extents |
| using | ExtentIndexType = Extents::ExtentIndexType |
| 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 | ConstMDSpanType = MDSpan<const DataType, Extents, LayoutPolicy> |
| using | ArrayBoundsIndexType = typename Extents::MDIndexType |
| using | IndexType = typename Extents::MDIndexType |
Public Member Functions | |
| constexpr | MDSpan (DataType *ptr, ArrayExtentsWithOffsetType extents) noexcept |
| constexpr | MDSpan (DataType *ptr, const DynamicDimsType &dims) noexcept |
| constexpr | MDSpan (const MDSpan< UnqualifiedValueType, Extents, LayoutPolicy > &rhs) noexcept |
| MDSpan (const MDSpan< DataType, Extents, LayoutPolicy > &rhs)=default | |
| constexpr | MDSpan (SmallSpan< DataType > v) noexcept |
| constexpr | MDSpan (ArrayView< UnqualifiedValueType > v) noexcept |
| constexpr | MDSpan (SmallSpan< UnqualifiedValueType > v) noexcept |
| constexpr | MDSpan (ConstArrayView< UnqualifiedValueType > v) noexcept |
| constexpr ThatClass & | operator= (SmallSpan< DataType > v) noexcept |
| constexpr ThatClass & | operator= (SmallSpan< UnqualifiedValueType > v) noexcept |
| constexpr ThatClass & | operator= (ArrayView< UnqualifiedValueType > v) noexcept |
| constexpr ThatClass & | operator= (ConstArrayView< UnqualifiedValueType > v) noexcept |
| MDSpan & | operator= (const MDSpan &v)=default |
| MDSpan & | operator= (MDSpan &&v) noexcept=default |
| constexpr DataType * | data () noexcept |
| Base pointer for allocated memory. | |
| constexpr const DataType * | data () const noexcept |
| Base pointer for allocated memory. | |
| constexpr DataType * | _internalData () |
| constexpr const DataType * | _internalData () const |
| ArrayExtents< Extents > | extents () const |
| ArrayExtentsWithOffsetType | extentsWithOffset () const |
| constexpr ExtentIndexType | extent0 () const |
| Value of the first dimension. | |
| constexpr ExtentIndexType | extent1 () const |
| Value of the second dimension. | |
| constexpr ExtentIndexType | extent2 () const |
| Value of the third dimension. | |
| constexpr ExtentIndexType | extent3 () const |
| Value of the fourth dimension. | |
| constexpr Int64 | offset (ExtentIndexType i, ExtentIndexType j, ExtentIndexType k, ExtentIndexType l) const |
| Value for element i,j,k,l. | |
| constexpr Int64 | offset (ExtentIndexType i, ExtentIndexType j, ExtentIndexType k) const |
| Value for element i,j,k. | |
| constexpr Int64 | offset (ExtentIndexType i, ExtentIndexType j) const |
| Value for element i,j. | |
| constexpr Int64 | offset (ExtentIndexType i) const |
| Value for element i. | |
| constexpr Int64 | offset (MDIndexType idx) const |
| Value for element idx. | |
| constexpr DataType & | operator() (ExtentIndexType i, ExtentIndexType j, ExtentIndexType k, ExtentIndexType l) const |
| Value for element i,j,k,l. | |
| constexpr DataType & | operator() (ExtentIndexType i, ExtentIndexType j, ExtentIndexType k) const |
| Value for element i,j,k. | |
| constexpr DataType & | operator() (ExtentIndexType i, ExtentIndexType j) const |
| Value for element i,j. | |
| constexpr DataType & | operator() (ExtentIndexType i) const |
| Value for element i. | |
| constexpr DataType | operator[] (ExtentIndexType i) const |
| Value for element i. | |
| constexpr DataType & | operator() (MDIndexType idx) const |
| Value for element idx. | |
| constexpr DataType * | ptrAt (ExtentIndexType i, ExtentIndexType j, ExtentIndexType k, ExtentIndexType l) const |
| Pointer to the value for element i,j,k,l. | |
| constexpr DataType * | ptrAt (ExtentIndexType i, ExtentIndexType j, ExtentIndexType k) const |
| Pointer to the value for element i,j,k. | |
| constexpr DataType * | ptrAt (ExtentIndexType i, ExtentIndexType j) const |
| Pointer to the value for element i,j. | |
| constexpr DataType * | ptrAt (ExtentIndexType i) const |
| Pointer to the value for element i. | |
| constexpr DataType * | ptrAt (MDIndexType idx) const |
| Pointer to the value for element i. | |
| __host__ __device__ MDSpan< DataType, RemovedFirstExtentsType, LayoutPolicy > | slice (ExtentIndexType i) const |
| Returns a dimension (N-1) view starting from index element i. | |
| constexpr MDSpan< const DataType, Extents, LayoutPolicy > | constSpan () const |
| constexpr MDSpan< const DataType, Extents, LayoutPolicy > | constMDSpan () const |
| constexpr Span< DataType > | to1DSpan () const |
| constexpr SmallSpan< DataType > | to1DSmallSpan () |
| constexpr SmallSpan< const DataType > | to1DSmallSpan () const |
| constexpr SmallSpan< const DataType > | to1DConstSmallSpan () const |
| constexpr auto | toSmallSpan () |
| 1D or 2D view on the instance (only if rank == 1 or rank == 2) | |
| constexpr auto | toSmallSpan () const |
| Constant 1D or 2D view on the instance (only if rank == 1 or rank == 2). | |
| constexpr auto | toConstSmallSpan () const |
| Constant 1D or 2D view on the instance (only if rank == 1 or rank == 2). | |
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 multidimensional 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 68 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::ArrayExtentsWithOffsetType = ArrayExtentsWithOffset<Extents, LayoutPolicy> |
Definition at line 63 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::ConstMDSpanType = MDSpan<const DataType, Extents, LayoutPolicy> |
Definition at line 66 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::DataType = DataType_ |
Definition at line 54 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::DynamicDimsType = typename Extents::DynamicDimsType |
Definition at line 64 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::ExtentIndexType = Extents::ExtentIndexType |
Definition at line 59 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::Extents = Extents_ |
Definition at line 55 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::ExtentsType = Extents |
Definition at line 58 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::IndexType = typename Extents::MDIndexType |
Definition at line 69 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::LayoutPolicy = LayoutPolicy_ |
Definition at line 56 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::LayoutPolicyType = LayoutPolicy |
Definition at line 60 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::LoopIndexType = MDIndexType |
Definition at line 62 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::MDIndexType = typename Extents::MDIndexType |
Definition at line 61 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType_, Extents_, LayoutPolicy_ >::RemovedFirstExtentsType = typename Extents::RemovedFirstExtentsType |
Definition at line 65 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 57 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 75 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 80 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 84 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 89 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 94 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 99 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 104 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 149 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 150 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 312 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 307 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Base pointer for allocated memory.
Definition at line 145 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Base pointer for allocated memory.
Definition at line 143 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value of the first dimension.
Definition at line 166 of file arccore/src/base/arccore/base/MDSpan.h.
Referenced by Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::toConstSmallSpan(), and Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::toSmallSpan().
|
inlineconstexpr |
Value of the second dimension.
Definition at line 168 of file arccore/src/base/arccore/base/MDSpan.h.
Referenced by Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::toConstSmallSpan(), and Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::toSmallSpan().
|
inlineconstexpr |
Value of the third dimension.
Definition at line 170 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value of the fourth dimension.
Definition at line 172 of file arccore/src/base/arccore/base/MDSpan.h.
|
inline |
Definition at line 154 of file arccore/src/base/arccore/base/MDSpan.h.
|
inline |
Definition at line 158 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i.
Definition at line 197 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j.
Definition at line 191 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k.
Definition at line 184 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k,l.
Definition at line 177 of file arccore/src/base/arccore/base/MDSpan.h.
Referenced by Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::operator()(), Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::operator()(), Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::operator()(), Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::operator()(), Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::operator()(), Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::operator[](), Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::ptrAt(), Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::ptrAt(), Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::ptrAt(), Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::ptrAt(), and Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::ptrAt().
|
inlineconstexpr |
Value for element idx.
Definition at line 201 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i.
Definition at line 228 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j.
Definition at line 222 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k.
Definition at line 216 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k,l.
Definition at line 209 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element idx.
Definition at line 241 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 123 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 130 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 109 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexprnoexcept |
Definition at line 116 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i.
Definition at line 234 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i.
Definition at line 269 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i,j.
Definition at line 263 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i,j,k.
Definition at line 256 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i,j,k,l.
Definition at line 249 of file arccore/src/base/arccore/base/MDSpan.h.
Referenced by Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::slice().
|
inlineconstexpr |
Pointer to the value for element i.
Definition at line 276 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 296 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 335 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 323 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 329 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 317 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Constant 1D or 2D view on the instance (only if rank == 1 or rank == 2).
Definition at line 361 of file arccore/src/base/arccore/base/MDSpan.h.
Referenced by Arcane::MDSpan< DataType, AddedFirstExtentsType, RightLayout >::toSmallSpan().
|
inlineconstexpr |
1D or 2D view on the instance (only if rank == 1 or rank == 2)
Definition at line 343 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Constant 1D or 2D view on the instance (only if rank == 1 or rank == 2).
Definition at line 354 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 374 of file arccore/src/base/arccore/base/MDSpan.h.
|
private |
Definition at line 373 of file arccore/src/base/arccore/base/MDSpan.h.