gpu::linalg::device_array
cheatah-gpu-linalg v0.4.4-alpha — Biome Standard 0.6.3-alpha
A dense, row-major, GPU-resident array.
Models cheatah's ArrayLike (host-resident shape / strides / ndim / size / offset + a uninitialized factory) so it flows through the linalg templates; its elements live in a shared-storage cheatah-gpu buffer.
Functions
An empty array: no shape, no buffer (assign a factory result to make it real).
Upload size() contiguous elements into this (already-allocated) array — device-local memory on Vulkan goes through a staged transfer; unified memory is a memcpy.
data | The host elements (size() of them, contiguous; bounds-checked against the allocation). |
O(n) transfer.
none fresh — the Vulkan staging buffer recycles through the pool.
none — writes into this array's existing buffer.
gpu:bridgeCopy size() elements back to host memory (the download mirror of write_from — a SYNC POINT).
out | The host destination (size() elements of room). |
O(n) transfer.
none fresh — the Vulkan readback stages through a pooled host-cached buffer.
none.
gpu:matmulThe dimensions, row-major.
O(1).
none.
The element strides (C-order, in elements).
O(1).
none.
The rank.
O(1).
none.
The element count.
O(1).
none.
The view offset — always 0 (device arrays are whole-buffer views).
O(1).
none.
A new view of the SAME buffer under a different (equal-size) contiguous shape — the zero-copy backend of reshape (shares ownership through the same shared_ptr).
shape | The new dimensions (caller guarantees the same element count — |
A sibling array sharing this one's device buffer.
O(ndim).
the new shape/strides vectors.
none — zero-copy by design.
gpu:elementwiseThe backend buffer handle (nullptr for an empty array) — NON-owning: the array keeps ownership, never pass it to release_buffer.
O(1).
none.
Allocate an uninitialized array of the given shape (the factory the allocating linalg fronts call as Array<T>::uninitialized({rows, cols})).
Throws on an element-count overflow and past the 2³²−1 element cap (the 32-bit kernel-indexing invariant).
shape | The dimensions, row-major. |
A fresh array whose elements are uninitialized device memory.
O(ndim) host metadata work; the buffer is a pooled acquire (hash lookup when recycled, one driver allocation otherwise).
the shape/strides vectors (O(ndim)).
one pooled device data buffer of size()·sizeof(T) — VRAM (device-local) on Vulkan, shared storage on Metal; released to the pool by the last owner's destructor.
gpu:matmulAllocate and upload size() contiguous row-major elements from host memory.
shape | The dimensions, row-major. |
data | The host elements (size() of them, contiguous). |
A fresh device array holding a copy of data.
O(n) transfer.
the O(ndim) metadata; the Vulkan upload stages through a pooled host-visible buffer.
one pooled device data buffer of size()·sizeof(T).
gpu:matmulConstants & variables
Shared owner of the backend buffer: the deleter releases it through the active backend's context when the last device_array sharing it goes away.
Types
The element type (the standard-container spelling of T).
