Expand description
The per-class capability matrix and the built-in backends (plan §3).
benchmark_devices (the existing AH-track probe) measures ONE GEMV and ranks
circuits globally. This extends that to a per-kernel-class matrix: each class
is measured on every available backend, and a winner is recorded per class
(the fastest backend for GEMV is not the fastest for an FFT). The result is what
ComputePolicy::select consults.
Built-in backends registered by default:
CpuBackend— the nativerayonreference kernels (super::reference), always available, a row for every class.WgpuBackend— the portable wgpu path. Today it measures theDenseLinearclass via the existingdevice_benchmarkGEMV (a real GPU number); the other classes have no portable GPU microkernel yet, so it returns no rows for them (recorded honestly as “not probed on GPU”, never faked). Those per-class GPU kernels land per module (plan P2/P5) and appear here with zero further wiring.
Structs§
- Class
Matrix - Measured per-class capability: for each class, the backend rows ranked
fastest-first.
best_foris the O(1)-ish lookup the STEM call sites use. - CpuBackend
- Native-CPU backend: the
rayonreference kernels. Always available. - Wgpu
Backend - Portable wgpu backend. Measures
DenseLinearvia the existing GEMV probe; other classes have no portable GPU microkernel yet (returns no rows — honest).
Functions§
- probe_
class_ matrix - Probe every available backend across every kernel class and assemble the ranked per-class matrix. Boot-time only (cache it in the passport).