Expand description
The dispatch entry the STEM substrate calls: accelerated_gemm_f32 runs C = A·B
on the GPU when the measured capability matrix says it wins and the job is big
enough to be worth the dispatch, and on a rayon CPU path otherwise. The CPU path
is always present and never hard-fails (§7).
The machine benchmark (crate::device_benchmark) runs once here, lazily, to
build the shared ComputePolicy; every subsequent call is the O(1) select.
f64 vs f32: this accelerated path is f32 (the GPU/WGSL reality and what the
throughput-bound callers want). The exact-f64 scientific GEMM
(crate::solvers::linear_algebra::gemm) is unchanged and stays on the CPU — the
bridge never silently downcasts a caller that asked for f64.
Enums§
- RanOn
- Which backend actually ran a dispatch (for observability and the correctness gate).
Functions§
- accelerated_
gemm_ f32 - Accelerated
C = A·B(f32).aism×k,bisk×n,cism×n(overwritten). Routes to the GPU when the measured matrix favours it forDenseLinear, the job clears [GPU_MIN_FLOPS], and it fits in GPU buffers; otherwise the CPU path. Returns which backend ran. On any GPU shortfall it falls back to CPU — never a hard fail. - shared_
policy - The shared compute policy, built once by probing this machine (the benchmark). The
heavy probe runs on first call; thereafter
selectis O(1).