Skip to main content

Module gemm

Module gemm 

Source
Expand description

Dynamic-size general matrix multiply (caller-owned, zero-heap) — the canonical dense-GEMM core the specialized libs and the GPU coop_gemv backend share. Dynamic-size general matrix multiply (GEMM) — the canonical dense-linear-algebra core.

This is the one dynamic GEMM for the engine. Before this, three private re-implementations competed (specialized_libs/linear_algebra heap GEMM, gguf_bridge GPU coop_gemv, and the fixed-size super::Matrix4x4). The specialized libs route their dynamic matmul here; the GPU coop_gemv kernel is the same contract executed on wgpu and is checked against this code as its CPU parity reference (gemm_parity_probe).

Idiom (matches [super::cholesky]): zero allocation, caller-owned row-major slices with explicit dimensions, fail-closed on a dimension mismatch ([SolversError::InvalidDimension]). No DMatrix, no heap, no dependency.

Enums§

Transpose
Whether a GEMM operand is used as stored (No) or transposed (Yes).

Functions§

gemm
General matrix multiply (BLAS-3 gemm shape), row-major, zero-heap:
matmul
Plain product C := A · B for A (m×k), B (k×n), C (m×n), all row-major and caller-owned. Thin wrapper over gemm with alpha = 1, beta = 0 and no transposes.
matvec
Matrix–vector product y := op(A) · x.
transpose
Transpose the m×n row-major matrix a into the n×m row-major buffer out. Caller-owned, zero-heap. a is m*n, out is n*m.