Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::ArrayStridesBase< RankValue > Class Template Reference

Class to maintain the stride in each dimension. More...

#include <arccore/base/ArrayExtents.h>

Public Member Functions

__host__ __device__ Int32 stride (int i) const
 Value of the stride for the i-th dimension.
__host__ __device__ Int32 operator() (int i) const
__host__ __device__ SmallSpan< const Int32asSpan () const
__host__ __device__ Int64 totalStride () const
 Total stride value.
__host__ __device__ ArrayStridesBase< RankValue - 1 > removeFirstStride () const

Static Public Member Functions

__host__ static __device__ ArrayStridesBase< RankValue > fromSpan (Span< const Int32 > strides)
 Constructs an instance from the values given in stride.

Protected Attributes

std::array< Int32, RankValue > m_strides = {}

Detailed Description

template<int RankValue>
class Arcane::ArrayStridesBase< RankValue >

Class to maintain the stride in each dimension.

The stride for a dimension is the memory distance between two elements of the array for that dimension. Generally, the stride is equal to the number of elements in the dimension unless padding is used, for example, to align certain dimensions.

Definition at line 66 of file arccore/src/base/arccore/base/ArrayExtents.h.

Member Function Documentation

◆ asSpan()

template<int RankValue>
__host__ __device__ SmallSpan< const Int32 > Arcane::ArrayStridesBase< RankValue >::asSpan ( ) const
inline

Definition at line 74 of file arccore/src/base/arccore/base/ArrayExtents.h.

◆ fromSpan()

template<int RankValue>
__host__ static __device__ ArrayStridesBase< RankValue > Arcane::ArrayStridesBase< RankValue >::fromSpan ( Span< const Int32 > strides)
inlinestatic

Constructs an instance from the values given in stride.

Precondition
stride.size() == RankValue.

Definition at line 92 of file arccore/src/base/arccore/base/ArrayExtents.h.

◆ operator()()

template<int RankValue>
__host__ __device__ Int32 Arcane::ArrayStridesBase< RankValue >::operator() ( int i) const
inline

Definition at line 73 of file arccore/src/base/arccore/base/ArrayExtents.h.

◆ removeFirstStride()

template<int RankValue>
__host__ __device__ ArrayStridesBase< RankValue - 1 > Arcane::ArrayStridesBase< RankValue >::removeFirstStride ( ) const
inline

Definition at line 84 of file arccore/src/base/arccore/base/ArrayExtents.h.

◆ stride()

template<int RankValue>
__host__ __device__ Int32 Arcane::ArrayStridesBase< RankValue >::stride ( int i) const
inline

Value of the stride for the i-th dimension.

Definition at line 72 of file arccore/src/base/arccore/base/ArrayExtents.h.

◆ totalStride()

template<int RankValue>
__host__ __device__ Int64 Arcane::ArrayStridesBase< RankValue >::totalStride ( ) const
inline

Total stride value.

Definition at line 76 of file arccore/src/base/arccore/base/ArrayExtents.h.

Member Data Documentation

◆ m_strides

template<int RankValue>
std::array<Int32, RankValue> Arcane::ArrayStridesBase< RankValue >::m_strides = {}
protected

The documentation for this class was generated from the following file: