pub enum Device {
Default,
Discrete {
index: usize,
},
Integrated {
index: usize,
},
Virtual {
index: usize,
},
Cpu,
}Expand description
Where to run the compute.
Each variant maps onto the concrete Device type of whichever cubecl
runtime was selected.
Not every variant makes sense on every backend. Integrated and
Virtual are wgpu-only, and Cpu does nothing on the cpu runtime
while selecting WgpuDevice::Cpu on wgpu.
Asking for a variant a runtime cannot honour returns an error from
the matching 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
The software device. Valid on the cpu runtime, and on wgpu
where it picks the lavapipe or 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.