Enum DeviceKind
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 WgpuDeviceKind 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 identifies an already registered runtime. To register an application’s
setup, use Device::wgpu_options().setup(setup).init() and retain the
returned device. Clone that device to share it; do not invent an existing ID.
Trait Implementations§
§impl Clone for DeviceKind
impl Clone for DeviceKind
§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 more§impl Debug for DeviceKind
impl Debug for DeviceKind
§impl Default for DeviceKind
impl Default for DeviceKind
§fn default() -> DeviceKind
fn default() -> DeviceKind
impl Eq for DeviceKind
§impl Hash for DeviceKind
impl Hash for DeviceKind
§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,
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().