Skip to content

FixedMetadata

#include <layout.hh>
template<typename T, ssize_t MaxNDim = NCARRAY_MAX_NDIM>
struct FixedMetadata

Defined in src/lib/ncarray/layout.hh:93

For simplifying CPU/GPU compatibility, STL containers are replaced with a fixed struct for expressing metadata surrounding arrays. E.g. shape and strides information. Currently, ncarray supports up to 10 dimensions in an array.

The FixedMetadata struct is a small component which is used for the holding of the above metadata. It has a data member (which will be the shape data, e.g.) and also holds its dimensionality in ndim. This struct is templated so the underlying type for the metadata arrays can be changed.

  • T The type of the underlying metadata being held.

  • MaxNDim The maximum array dimensionality.

Name Kind Owner
data variable Declared here
ndim variable Declared here
operator[] function Declared here
operator[] function Declared here
set function Declared here
value_type typedef Declared here
Return Name Description
T data
ssize_t ndim

T data { 0 }

Defined in src/lib/ncarray/layout.hh:97


ssize_t ndim { 0 }

Defined in src/lib/ncarray/layout.hh:98

Return Name Description
NCA_HD constexpr T & operator[] inline constexpr
NCA_HD constexpr const T & operator[] const inline constexpr
NCA_HD void set inline

inline constexpr

constexpr inline NCA_HD constexpr T & operator[](ssize_t i)

Defined in src/lib/ncarray/layout.hh:101


const inline constexpr

constexpr inline NCA_HD constexpr const T & operator[](ssize_t i) const

Defined in src/lib/ncarray/layout.hh:105


inline

inline NCA_HD void set(const T * vals, ssize_t n)

Defined in src/lib/ncarray/layout.hh:109

Name Description
value_type

using value_type = T

Defined in src/lib/ncarray/layout.hh:95