pub enum Device {
Default,
Discrete {
index: usize,
},
Integrated {
index: usize,
},
Virtual {
index: usize,
},
Cpu,
}Expand description
Where to run the compute. The library maps each variant onto the
concrete Device type of whichever cubecl runtime was selected.
Some variants are only meaningful for certain backends. Integrated
and Virtual are wgpu-only; Cpu is a no-op on the cpu runtime
and selects WgpuDevice::Cpu on wgpu. Asking for a variant on a
runtime that can’t honour it returns an error from the relevant
to_* conversion.
Variants§
Default
Backend-chosen default device.
Discrete
Discrete GPU at ordinal index.
Maps to CudaDevice { index }, AmdDevice { index }, or
WgpuDevice::DiscreteGpu(index).
Integrated
Integrated GPU at ordinal index. wgpu-only.
Virtual
Virtual GPU at ordinal index. wgpu-only.
Cpu
Software/CPU device. Valid on the cpu runtime and on wgpu
(where it picks the lavapipe / software adapter).
Implementations§
Trait Implementations§
impl Eq for Device
impl StructuralPartialEq for Device
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnsafeUnpin for Device
impl UnwindSafe for Device
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
Mutably borrows from an owned value. Read more
Source§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
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
Compare self to
key and return true if they are equal.