std :: ml::gpu_spirv
Struct std::SpirvBuf
struct SpirvBuf {
unsigned long handle;
unsigned long bytes;
int dtype;
}A Vulkan device buffer. 'handle' is its buffer device address (what the kernels and VulkanTensor.device_buffer() name it by), 0 for an invalid (failed or freed) buffer; every op returns 0 for one. 'bytes' is the size it was made with, 'dtype' its element type (informational: the ops below take fp32). Buffers come from the device's memory cache; free() returns one to it, exactly once, and may wait for queued work that uses it.
Fields
Methods
handle != 0
back to the cache; handle := 0
Copies the first 'bytes' (<= this.bytes, whole 32-bit words) into 'dst' once the queued work is done (waits). 1 = done.
Copies src.len bytes (<= this.bytes, whole 32-bit words) from 'src' into the buffer, in order with the queued work (ops queued before it read the old contents). 1 = done.
n uninitialized elements