Snakepit.Hardware.MPSDetector (Snakepit v0.8.7)

View Source

Apple Metal Performance Shaders (MPS) hardware detection.

Detects Apple Silicon GPU availability on macOS.

Summary

Functions

Detects MPS (Apple Metal) availability.

Types

mps_info()

@type mps_info() :: %{
  available: boolean(),
  device_name: String.t(),
  memory_total_mb: non_neg_integer()
}

Functions

detect()

@spec detect() :: mps_info() | nil

Detects MPS (Apple Metal) availability.

Returns nil on non-macOS platforms, or a map with:

  • :available - true if MPS is available
  • :device_name - Name of the Metal device
  • :memory_total_mb - GPU memory (shared memory on Apple Silicon)