Expand description
Metal device interface.
Corresponds to Metal/MTLDevice.hpp.
The Device represents a GPU that can execute Metal commands. Use the
system_default function to get the default GPU, or copy_all_devices
(macOS only) to enumerate all available GPUs.
§Example
ⓘ
use mtl_gpu::device;
// Get the default GPU
let device = device::system_default().expect("no Metal device");
println!("Using GPU: {}", device.name());Structs§
- Architecture
- GPU architecture information.
- Device
- A Metal device representing a GPU.
- Device
Observer - Device observer handle.
Functions§
- copy_
all_ devices - Copy all available Metal devices (macOS only).
- copy_
all_ devices_ with_ observer - Copy all devices with an observer for hot-plug notifications (macOS only).
- remove_
device_ observer - Remove a device observer (macOS only).
- system_
default - Create the system default Metal device.
Type Aliases§
- Timestamp
- Timestamp type for CPU/GPU timestamp queries.