Expand description
WGSL shader source generation for common compute kernels.
Each function returns a complete, self-contained WGSL source string
suitable for passing to device.create_shader_module().
Functionsยง
- attention_
wgsl - Generate a WGSL compute shader for scaled dot-product attention.
- batched_
gemm_ wgsl - Generate WGSL source for a batched (strided) GEMM kernel.
- binary_
wgsl - Generate WGSL source for an element-wise binary operation.
- conv2d_
wgsl - Generate a WGSL compute shader for 2D convolution in NCHW format.
- elementwise_
wgsl - Generate WGSL source for an element-wise unary operation.
- gemm_
wgsl - Generate WGSL source for a tiled GEMM kernel:
C = alpha * A * B + beta * C. - gemm_
wgsl_ f16 - Generate WGSL source for a tiled GEMM kernel using FP16 storage.
- reduction_
final_ wgsl - Generate WGSL for the final scalar reduction of partial sums.
- reduction_
nd_ wgsl - Generate WGSL source for an N-D reduction along a single axis.
- reduction_
wgsl - Generate WGSL source for a parallel workgroup-level reduction.