Skip to main content

system_default

Function system_default 

Source
pub fn system_default() -> Option<Device>
Expand description

Create the system default Metal device.

Returns the default GPU for this system. On systems with multiple GPUs, this typically returns the most capable GPU.

C++ equivalent: MTL::Device* MTL::CreateSystemDefaultDevice()

§Example

use mtl_gpu::device;

let device = device::system_default().expect("no Metal device available");
println!("GPU: {}", device.name());