skip to content
==> README.md <==
1# @ajax/mesh-ref-gemm
2
3The `gemm` native program's inputs and reference: `A[i][k] = ((7i + 13k) mod 17) / 8 - 1` and
4`B[k][j] = ((5k + 11j) mod 19) / 9 - 1` (small exact fractions), `C = A B` summed in f64 with the
5per-element error scale `Σ |a| |b|`, and `max_rel_err`, the bound an f32 GEMM is checked against (well
6under 1e-5 at n = 64).
7
8**Ported from** `crates/mesh-ref/src/lib.rs`, module `gemm`. Host (uses `fabs`, `malloc`; link `-lm`).
9
10**Tested** by a golden digest from the Rust over the inputs, the reference sums and scales, and the
11error, at n = 1, 7 and 64.
12
13## Differences
14
15- Rust returns `Vec`s; here the caller passes buffers (`max_rel_err` allocates its own and returns NaN if
16  it can't).