Skip to main content

Module matrix

Module matrix 

Source
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 native rayon reference kernels (super::reference), always available, a row for every class.
  • WgpuBackend — the portable wgpu path. Today it measures the DenseLinear class via the existing device_benchmark GEMV (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§

ClassMatrix
Measured per-class capability: for each class, the backend rows ranked fastest-first. best_for is the O(1)-ish lookup the STEM call sites use.
CpuBackend
Native-CPU backend: the rayon reference kernels. Always available.
WgpuBackend
Portable wgpu backend. Measures DenseLinear via 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).