The gemm native program's inputs (exact small fractions) and its f64 reference with error bound
$ sexc add @ajax/mesh-ref-gemm- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 01:59v/# 1 version
- drwxr-xr-x-Oct 27 01:59files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 01:59 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- none
- dependents
- @ajax/mesh-prog-gemm
- keywords
- alphaos mesh reference gemm
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-ref-gemm
- repository
- https://github.com/thomasdavis/alpha-c-mesh
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).