Expand description
The dispatch entry the STEM substrate calls: accelerated_gemm_f32 runs C = A·B
on the GPU when gpu-runtime is on, the measured capability matrix says it
wins, and the job is big enough to be worth the dispatch; otherwise a rayon CPU
path. The CPU path is always present and never hard-fails (§7).
With gpu-runtime, the machine benchmark (crate::device_benchmark) runs
once here, lazily, to build the shared ComputePolicy; every subsequent
call is the O(1) select. Without that feature there is no GPU probe and no
matrix — the path is always CPU (RanOn::Cpu).
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). Withgpu-runtime, routes to the GPU when the measured matrix favours it forDenseLinear, the job clearsGPU_MIN_FLOPS, and it fits in GPU buffers; otherwise the CPU path. Withoutgpu-runtimethis is always the rayon CPU path and never reportsRanOn::Gpu. 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). Withoutgpu-runtimethere is no GPU probe — the policy is CPU-only.