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; never cast the
MLX array's internal pointer to a CPU pointer — the buffer is GPU-private
until evaluated (see TensorImpl::eval).
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.