GPU tensor storage backed by an mlx::core::array lazy graph node.
The arr shared pointer keeps the MLX graph node alive for as long as
this GpuStorage (and any TensorImpl that holds it) is in
scope. All GPU-stream operations dispatch through MLX. Read the array's
data pointer from the CPU only after it is evaluated (see
TensorImpl::eval) — before that the buffer may not exist.
See Also
CpuStorage — CPU sibling variant.
SharedStorage — unified-memory sibling variant.
Attributes
arrstd::shared_ptr<mlx::core::array>Opaque handle to the MLX lazy graph node.
nbytesstd::size_tAllocation capacity in bytes (logical — MLX may not have materialised the buffer yet).
dtypeDtypeElement type. Default
Dtype::F32.versionstd::shared_ptr<VersionCounter>Shared mutation counter — same semantics as
CpuStorage.