Module ml::tensor_spirv
GPU-backed Tensor ops (Vulkan/SPIR-V (cross-vendor)).
Per-op GPU tensor functions over gpu_spirv.h's host-array ops: each uploads its operands, runs on the Vulkan GPU and reads the result back into a CPU tensor, which joins the graph as the CPU op's result would (backward runs on the CPU), and computes on the CPU without a Vulkan GPU. Tensor is float32 (see tensor.h), the precision every spirv_*_f32 op takes, so these read and write a Tensor's 'data' directly. Each op pays an upload and a wait: for a model, place its tensors on DEVICE_VULKAN (device.h) instead, which keeps them on the GPU across ops and runs the backward pass there too.
Functions
| tensor_add_spirv | |
| tensor_sub_spirv | |
| tensor_mul_spirv | |
| tensor_matmul_spirv |