Expand description
Opaque numeric storage for builders and frames (metatensor v0.2.x shape).
Design: internal data is DLPack-shaped (shape / dtype / device /
as_dlpack(device, stream, max_version)), not “AoS structs with a DLPack
export bolt-on.” Callers query storage dtype/device, then as_dlpack
with a requested device (and stream / max version)—same contract as
metatensor mts_array_t. Choosing f32 vs f64 is choosing storage
(or a future typed builder), not passing a cast-target on every export.
ConFrame keeps row-major ArcArray blocks for positions and optional
sections; atom_data is the CON-text AoS projection for the writer.
Implementors can swap dtypes (f32 / f64 / u64 / bool), devices (CPU /
future GPU), and ownership (ArrayD, Arc<RwLock<...>>, …) without
changing the public surface.
The default backing is Arc<RwLock<ndarray::ArrayD<T>>> –
Arc: multiple DLPack views can share the same buffer across threads / FFI consumers.RwLock: enforces aliasing soundness; concurrent reads are non-blocking, concurrent writes contend.ndarray::ArrayD<T>: type-erased dimension, generic dtype, ndarray’s allocator (8-byte aligned, fine for f64; future SIMD-aligned variants implement this trait separately).
See docs/orgmode/spec.org §17 for the public contract.
Structs§
- Device
Tagged F64Array - Host-resident
f64buffer tagged with a DLPackdevice(CPU or non-CPU).
Traits§
- Array
- Storage hook for one per-atom field of a ConFrameBuilder.
Functions§
- allocate_
array_ on_ device - Allocate a new zeroed array on
device. - array_
from_ host_ f64_ on_ device - Install a device-tagged f64 array (caller-supplied buffer / logical device).
- array_
from_ shape - Convenience constructor for the default backing.
- from_
dlpack_ f64 - Ingest from a DLPack tensor: preserve
tensor.device()and copy f64 host elements when the tensor is CPU-addressable; for non-CPU tensors in this build we still preserve the device tag using host staging only when the tensor reports f64 data that is readable (host tests tag CUDA with host bytes). Pure allocate-on-GPU without a backend isallocate_array_on_device.