Snakepit.Hardware.Detector (Snakepit v0.8.7)
View SourceUnified hardware detection module.
Aggregates CPU, CUDA, MPS, and ROCm detection into a single hardware info structure. Results are cached in ETS for performance.
Summary
Functions
Returns hardware capability flags.
Clears the hardware detection cache.
Detects all hardware information.
Types
@type accelerator() :: :cpu | :cuda | :mps | :rocm
@type hardware_info() :: %{ accelerator: accelerator(), cpu: Snakepit.Hardware.CPUDetector.cpu_info(), cuda: Snakepit.Hardware.CUDADetector.cuda_info() | nil, mps: Snakepit.Hardware.MPSDetector.mps_info() | nil, rocm: Snakepit.Hardware.ROCmDetector.rocm_info() | nil, platform: String.t() }
Functions
@spec capabilities() :: capabilities()
Returns hardware capability flags.
Returns a map of boolean capability flags for quick feature checks.
@spec clear_cache() :: :ok
Clears the hardware detection cache.
Forces re-detection on next call to detect/0 or capabilities/0.
@spec detect() :: hardware_info()
Detects all hardware information.
Returns a map with aggregated hardware info from all detectors. Results are cached for performance.