Skip to main content

Module shader

Module shader 

Source
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ยง

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.
reduction_final_wgsl
Generate WGSL for the final scalar reduction of partial sums.
reduction_wgsl
Generate WGSL source for a parallel workgroup-level reduction.