pub fn gemm_f32(
m: usize,
k: usize,
n: usize,
a: &[f32],
b: &[f32],
) -> Result<Vec<f32>, ForgeError>Expand description
Best-path single-precision dense GEMM: row-major C[M×N] = A[M×K] · B[K×N].
Path selection:
- WGSL GPU — when
caps().wgpuis set and the problem is at leastGEMM_GPU_THRESHOLDFMAs, run the certified GEMM via the sharedForgeRuntime. If the runtime cannot be built or the dispatch errors at runtime, the error is not propagated — the call falls through to the CPU floor so it is never broken. - CPU floor — otherwise (no GPU, sub-threshold, or GPU fell through) compute
on the CPU via
gemm_cpu.
a must have m * k elements, b must have k * n; both row-major. Returns
m * n row-major elements. Dimension/length mismatches are the only hard errors.