Skip to main content

Module device

Module device 

Source
Expand description

Which physical device to run on.

A Device picks the hardware inside a backend, while Accelerator picks the backend itself. The two are chosen separately because most backends expose more than one device.

Device implements FromStr, so it can be taken straight from a command-line flag or a config file.

use av_denoise_core::Device;

// Let the backend decide.
assert_eq!("default".parse::<Device>().unwrap(), Device::Default);

// Or name the second discrete GPU in the machine.
assert_eq!(
    "discrete:1".parse::<Device>().unwrap(),
    Device::Discrete { index: 1 },
);

Enumsยง

Device
Where to run the compute.