shape_t#

Fully qualified name: wp::shape_t

struct shape_t#

Dimension descriptor for a Warp array.

Stores up to :data:ARRAY_MAX_DIMS element counts. Trailing unused slots are left zero. Layout matches wp::shape_t in the native Warp runtime so a wp.array struct can be reinterpret_cast’d directly.

Public Functions

inline shape_t()#
inline int operator[](int i) const#

Returns the element count for the given dimension.

Parameters:

i[in] Zero-based dimension index, must be less than ARRAY_MAX_DIMS.

Returns:

The element count of dimension i.

inline int &operator[](int i)#

Returns a mutable reference to the element count for the given dimension.

Parameters:

i[in] Zero-based dimension index, must be less than ARRAY_MAX_DIMS.

Returns:

Reference to the element count of dimension i.

Public Members

int dims[ARRAY_MAX_DIMS]#

Per-dimension element counts; trailing unused slots are zero.