# `Snakepit.Hardware.Detector`
[🔗](https://github.com/nshkrdotcom/snakepit/blob/v0.13.0/lib/snakepit/hardware/detector.ex#L1)

Unified hardware detection module.

Aggregates CPU, CUDA, MPS, and ROCm detection into a single hardware info structure.
Results are cached in ETS for performance.

# `accelerator`

```elixir
@type accelerator() :: :cpu | :cuda | :mps | :rocm
```

# `capabilities`

```elixir
@type capabilities() :: %{
  cuda: boolean(),
  mps: boolean(),
  rocm: boolean(),
  avx: boolean(),
  avx2: boolean(),
  avx512: boolean(),
  cuda_version: String.t() | nil,
  cudnn_version: String.t() | nil,
  cudnn: boolean()
}
```

# `hardware_info`

```elixir
@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()
}
```

# `capabilities`

```elixir
@spec capabilities() :: capabilities()
```

Returns hardware capability flags.

Returns a map of boolean capability flags for quick feature checks.

# `clear_cache`

```elixir
@spec clear_cache() :: :ok
```

Clears the hardware detection cache.

Forces re-detection on next call to detect/0 or capabilities/0.

# `detect`

```elixir
@spec detect() :: hardware_info()
```

Detects all hardware information.

Returns a map with aggregated hardware info from all detectors.
Results are cached for performance.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
