Skip to main content

gemm_reference

Function gemm_reference 

Source
pub fn gemm_reference(
    m: usize,
    n: usize,
    k: usize,
    a: &[f32],
    b: &[f32],
    c: &mut [f32],
) -> Result<(), TruenoError>
Expand description

Scalar reference GEMM for Jidoka validation

Computes C += A * B where:

  • A is M x K (row-major)
  • B is K x N (row-major)
  • C is M x N (row-major)

This is the “gold standard” implementation used to validate optimized versions.

§References

This implements the naive O(MNK) algorithm as described in Golub & Van Loan (2013), Matrix Computations, 4th ed., Algorithm 1.1.1.