Enum burn::backend::wgpu::WgpuDevice
pub enum WgpuDevice {
DiscreteGpu(usize),
IntegratedGpu(usize),
VirtualGpu(usize),
Cpu,
BestAvailable,
Existing(Id<Device>),
}
Expand description
The device struct when using the wgpu
backend.
Note that you need to provide the device index when using a GPU backend.
§Example
use cubecl_wgpu::WgpuDevice;
let device_gpu_1 = WgpuDevice::DiscreteGpu(0); // First discrete GPU found.
let device_gpu_2 = WgpuDevice::DiscreteGpu(1); // Second discrete GPU found.
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.
BestAvailable
The best available device found with the current graphics API.
Priority
- DiscreteGpu
- IntegratedGpu
- VirtualGpu
- Cpu
§Notes
A device might be identified as Other by wgpu, in this case, we chose this device over
IntegratedGpu
since it’s often a discrete GPU.
Existing(Id<Device>)
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.
The device is indexed by the global wgpu adapter ID.
Trait Implementations§
§impl Clone for WgpuDevice
impl Clone for WgpuDevice
§fn clone(&self) -> WgpuDevice
fn clone(&self) -> WgpuDevice
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for WgpuDevice
impl Debug for WgpuDevice
§impl Default for WgpuDevice
impl Default for WgpuDevice
§fn default() -> WgpuDevice
fn default() -> WgpuDevice
§impl Hash for WgpuDevice
impl Hash for WgpuDevice
§impl PartialEq for WgpuDevice
impl PartialEq for WgpuDevice
impl Eq for WgpuDevice
impl StructuralPartialEq for WgpuDevice
Auto Trait Implementations§
impl Freeze for WgpuDevice
impl !RefUnwindSafe for WgpuDevice
impl Send for WgpuDevice
impl Sync for WgpuDevice
impl Unpin for WgpuDevice
impl !UnwindSafe for WgpuDevice
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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<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
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()
.