CPU tensor storage backed by a posix_memalign allocation.
Ownership is shared: multiple TensorImpl views may hold a copy of
ptr that points into the same physical allocation. The
VersionCounter is also shared so a mutation through one view is
visible to every other view that aliases the same bytes.
All Apple Accelerate / BLAS / vDSP code paths read and write this variant.
See Also
DataBuffer — allocator-layer twin.
GpuStorage — GPU sibling variant.
SharedStorage — unified-memory sibling variant.
Attributes
ptrstd::shared_ptr<std::byte[]>nbytesstd::size_tdtypeDtypeDtype::F32.versionstd::shared_ptr<VersionCounter>bump_version.Constructors
1CpuStorage
void CpuStorage()Default-constructs an empty CpuStorage (null pointer, zero bytes, default F32 dtype, fresh version counter).
Methods
3Atomically increments the shared version counter.
Reads the current version counter value.
Returns
std::uint64_tMonotonically non-decreasing snapshot of mutation count.
Wraps this CpuStorage back into a DataBuffer.
No allocation occurs — the returned StoragePtr aliases the
same ptr and shares the same version counter.
Returns
StoragePtrHeap-allocated DataBuffer mirroring this storage's fields.