![]() |
HydroCouple
2.0.0-alpha.1
HydroCouple Interface Definitions
|
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>
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. | |
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.
| void* HydroCouple::BufferDescriptor::data = nullptr |
Base address of element (0, 0, ..., 0).
| int32_t HydroCouple::BufferDescriptor::deviceId = 0 |
Device ordinal when space is Device/Unified.
| DataKind HydroCouple::BufferDescriptor::kind = DataKind::Unknown |
Element type.
| int32_t HydroCouple::BufferDescriptor::rank = 0 |
Number of dimensions; 0 denotes a scalar.
| const int64_t* HydroCouple::BufferDescriptor::shape = nullptr |
Extent per dimension; length == rank.
| MemorySpace HydroCouple::BufferDescriptor::space = MemorySpace::Host |
Memory space holding the bytes.
| const int64_t* HydroCouple::BufferDescriptor::stridesBytes = nullptr |
Byte step per dimension; nullptr => C-contiguous.