pub enum DeviceKind {
DiscreteGpu(usize),
IntegratedGpu(usize),
VirtualGpu(usize),
Cpu,
DefaultDevice,
Existing(u32),
}Expand description
Selector for the more flexible backends whose device handle is a tagged enum (e.g. WGPU, which can target a discrete/integrated/virtual GPU, a CPU adapter, an externally-created wgpu setup, or just “best available”).
The variants mirror WgpuDevice from cubecl so the mapping is direct, but
it is kept as a burn-owned enum so callers don’t have to depend on cubecl.
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
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 from the wgpu runtime.
Trait Implementations§
Source§impl Clone for DeviceKind
impl Clone for DeviceKind
Source§fn clone(&self) -> DeviceKind
fn clone(&self) -> DeviceKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeviceKind
impl Debug for DeviceKind
Source§impl Default for DeviceKind
impl Default for DeviceKind
Source§fn default() -> DeviceKind
fn default() -> DeviceKind
impl Eq for DeviceKind
Source§impl Hash for DeviceKind
impl Hash for DeviceKind
Source§impl PartialEq for DeviceKind
impl PartialEq for DeviceKind
impl StructuralPartialEq for DeviceKind
Auto Trait Implementations§
impl Freeze for DeviceKind
impl RefUnwindSafe for DeviceKind
impl Send for DeviceKind
impl Sync for DeviceKind
impl Unpin for DeviceKind
impl UnsafeUnpin for DeviceKind
impl UnwindSafe for DeviceKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more