Expand description
Runtime hardware capability detection: probe once, report a plain
struct, and let every performance-relevant decision (thread pool
width, SIMD kernel selection, GPU residency) derive from the
detected machine rather than being hardcoded. Ferrox
today only has a CPU execution path, so HardwareProfile::detect()
is honest about that: the CUDA fields are always populated (zero /
false / None) unless built with --features cuda, and even then
they report exactly what ferrox-cuda’s device probe finds, no
more.
Everything in this module is real and testable in any environment, including one with no GPU: CPU core count and SIMD flags are always detectable, and “zero CUDA devices found” is itself a correct, verifiable answer on a CPU-only host, not a stand-in for an untested code path.
Structs§
- Hardware
Profile - A snapshot of the host’s inference-relevant capabilities. CPU/RAM
fields are always real; CUDA fields are always present but only
ever non-default when built with
--features cudaon a host that actually has a CUDA-capable device. - Simd
Caps - CPU SIMD instruction-set availability (runtime-detected via
is_x86_feature_detected!, not compile-time#[cfg]), matching the fieldsferrox_quant’s kernel dispatch actually checks.