HydroCouple  2.0.0-alpha.1
HydroCouple Interface Definitions
Loading...
Searching...
No Matches
HydroCouple::BufferDescriptor Struct Reference

BufferDescriptor describes a typed, possibly strided, possibly device-resident multi-dimensional array. It is the sole currency of field data exchange. More...

#include <hydrocouple.h>

Collaboration diagram for HydroCouple::BufferDescriptor:

Public Attributes

void * data = nullptr
 Base address of element (0, 0, ..., 0).
 
DataKind kind = DataKind::Unknown
 Element type.
 
int32_t rank = 0
 Number of dimensions; 0 denotes a scalar.
 
const int64_t * shape = nullptr
 Extent per dimension; length == rank.
 
const int64_t * stridesBytes = nullptr
 Byte step per dimension; nullptr => C-contiguous.
 
MemorySpace space = MemorySpace::Host
 Memory space holding the bytes.
 
int32_t deviceId = 0
 Device ordinal when space is Device/Unified.
 

Detailed Description

BufferDescriptor describes a typed, possibly strided, possibly device-resident multi-dimensional array. It is the sole currency of field data exchange.

The layout model follows the DLPack/NumPy buffer protocol: element (i0, i1, ..., i[rank-1]) lives at data + sum(ik * stridesBytes[k]). A null stridesBytes means C-contiguous row-major layout. The descriptor does not own its memory or its shape/stride arrays; the caller guarantees they outlive the call. Dimension semantics (which axis is time, entity, layer, ...) are supplied by the owning IComponentDataItem's dimensions() metadata, not by this struct.

This is a plain aggregate: the interface standard carries no executable code. Non-normative helper functions for descriptors (element counts, contiguity checks, byte offsets, factories) are provided separately in hydrocouplehelpers.h.

Member Data Documentation

◆ data

void* HydroCouple::BufferDescriptor::data = nullptr

Base address of element (0, 0, ..., 0).

◆ deviceId

int32_t HydroCouple::BufferDescriptor::deviceId = 0

Device ordinal when space is Device/Unified.

◆ kind

DataKind HydroCouple::BufferDescriptor::kind = DataKind::Unknown

Element type.

◆ rank

int32_t HydroCouple::BufferDescriptor::rank = 0

Number of dimensions; 0 denotes a scalar.

◆ shape

const int64_t* HydroCouple::BufferDescriptor::shape = nullptr

Extent per dimension; length == rank.

◆ space

MemorySpace HydroCouple::BufferDescriptor::space = MemorySpace::Host

Memory space holding the bytes.

◆ stridesBytes

const int64_t* HydroCouple::BufferDescriptor::stridesBytes = nullptr

Byte step per dimension; nullptr => C-contiguous.


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