Expand description
SPIR-V compute kernel generators for the Level Zero backend.
This module provides:
- A lightweight
SpvModulebuilder for emitting valid SPIR-V binaries. - Generator functions for unary, binary, reduce, and GEMM
compute kernels consumed by Level Zero’s
zeModuleCreate. - The original
trivial_compute_shaderplaceholder used for validation.
All generated kernels use the OpenCL SPIR-V execution model (Kernel)
with Physical64/OpenCL memory model. Buffer parameters are
CrossWorkgroup pointers; scalar parameters are passed by value via
zeKernelSetArgumentValue.
The generated SPIR-V targets version 1.2 (widely supported by Level Zero).
Structs§
- SpvModule
- Lightweight SPIR-V word-stream builder.
Constants§
- SPIRV_
GENERATOR - Generator magic — OxiCUDA Level Zero backend.
- SPIRV_
MAGIC - SPIR-V magic number.
- SPIRV_
VERSION_ 1_ 2 - SPIR-V version 1.2.
Functions§
- batched_
gemm_ compute_ shader - Generate an OpenCL SPIR-V compute kernel for batched GEMM.
- binary_
compute_ shader - Generate an OpenCL SPIR-V compute kernel for an element-wise binary operation.
- gemm_
compute_ shader - Generate an OpenCL SPIR-V compute kernel for GEMM:
C = alpha * A * B + beta * C. - reduce_
compute_ shader - Generate an OpenCL SPIR-V compute kernel for reduction along an axis.
- trivial_
compute_ shader - Build a minimal valid Shader-style compute shader:
void main() {}. - trivial_
compute_ shader_ bytes - Return the trivial compute shader as a byte slice suitable for passing to Level Zero module creation.
- unary_
compute_ shader - Generate an OpenCL SPIR-V compute kernel for an element-wise unary operation.