Skip to main content

DefaultDevice

Type Alias DefaultDevice 

Source
pub type DefaultDevice = WgpuDevice;

Aliased Type§

pub enum DefaultDevice {
    DiscreteGpu(usize),
    IntegratedGpu(usize),
    VirtualGpu(usize),
    Cpu,
    DefaultDevice,
    BestAvailable,
    Existing(u32),
}

Variants§

§

DiscreteGpu(usize)

Discrete GPU with the given index. The index is the index of the discrete GPU in the list of all discrete GPUs found on the system.

§

IntegratedGpu(usize)

Integrated GPU with the given index. The index is the index of the integrated GPU in the list of all integrated GPUs found on the system.

§

VirtualGpu(usize)

Virtual GPU with the given index. The index is the index of the virtual GPU in the list of all virtual GPUs found on the system.

§

Cpu

CPU.

§

DefaultDevice

The best available device found with the current graphics API.

This will prioritize GPUs wgpu recognizes as “high power”. Additionally, you can override this using the CUBECL_WGPU_DEFAULT_DEVICE environment variable. This variable is spelled as if i was a WgpuDevice, so for example CUBECL_WGPU_DEFAULT_DEVICE=IntegratedGpu(1) or CUBECL_WGPU_DEFAULT_DEVICE=Cpu

§

BestAvailable

👎Deprecated

Deprecated, use DefaultDevice.

§

Existing(u32)

Use an externally created, existing, wgpu setup. This is helpful when using CubeCL in conjunction with some existing wgpu setup (eg. egui or bevy), as resources can be transferred in & out of CubeCL.

§Notes

This can be initialized with init_device.