Base class for multidimensional views. More...
Public Types | |
| 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 | ArrayBoundsIndexType = typename Extents::MDIndexType |
| using | IndexType = typename Extents::MDIndexType |
Public Member Functions | |
| constexpr | MDSpan (DataType *ptr, ArrayExtentsWithOffsetType extents) |
| constexpr | MDSpan (DataType *ptr, const DynamicDimsType &dims) |
| template<typename X, typename = std::enable_if_t<std::is_same_v<X, UnqualifiedValueType>>> | |
| constexpr | MDSpan (const MDSpan< X, Extents > &rhs) |
| constexpr | MDSpan (SmallSpan< DataType > v) |
| constexpr | MDSpan (SmallSpan< const DataType > v) |
| constexpr ThatClass & | operator= (SmallSpan< DataType > v) |
| constexpr ThatClass & | operator= (SmallSpan< const DataType > v) |
| constexpr DataType * | data () |
| Base pointer for allocated memory. | |
| constexpr const DataType * | data () const |
| 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 |
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 42 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 >::ExtentIndexType = Extents::ExtentIndexType |
Definition at line 55 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::ExtentsType = Extents |
Definition at line 54 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 48 of file arccore/src/base/arccore/base/MDSpan.h.
|
private |
Definition at line 44 of file arccore/src/base/arccore/base/MDSpan.h.
| using Arcane::MDSpan< DataType, Extents, LayoutPolicy >::value_type = DataType |
Definition at line 53 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 90 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 119 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 120 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 282 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 277 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Base pointer for allocated memory.
Definition at line 113 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Base pointer for allocated memory.
Definition at line 115 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value of the first dimension.
Definition at line 136 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value of the second dimension.
Definition at line 138 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value of the third dimension.
Definition at line 140 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value of the fourth dimension.
Definition at line 142 of file arccore/src/base/arccore/base/MDSpan.h.
|
inline |
Definition at line 124 of file arccore/src/base/arccore/base/MDSpan.h.
|
inline |
Definition at line 128 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i.
Definition at line 167 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j.
Definition at line 161 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k.
Definition at line 154 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k,l.
Definition at line 147 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 171 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i.
Definition at line 198 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j.
Definition at line 192 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k.
Definition at line 186 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i,j,k,l.
Definition at line 179 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element idx.
Definition at line 211 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 102 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 95 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Value for element i.
Definition at line 204 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i.
Definition at line 239 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i,j.
Definition at line 233 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i,j,k.
Definition at line 226 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Pointer to the value for element i,j,k,l.
Definition at line 219 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 246 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 266 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 301 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 292 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 297 of file arccore/src/base/arccore/base/MDSpan.h.
|
inlineconstexpr |
Definition at line 287 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 49 of file arccore/src/base/arccore/base/MDSpan.h.
|
private |
Definition at line 310 of file arccore/src/base/arccore/base/MDSpan.h.
|
private |
Definition at line 309 of file arccore/src/base/arccore/base/MDSpan.h.