Enum burn_wgpu::WgpuDevice
source · pub enum WgpuDevice {
DiscreteGpu(usize),
IntegratedGpu(usize),
VirtualGpu(usize),
Cpu,
BestAvailable,
}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 burn_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.
Trait Implementations§
source§impl Clone for WgpuDevice
impl Clone for WgpuDevice
source§fn clone(&self) -> WgpuDevice
fn clone(&self) -> WgpuDevice
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for WgpuDevice
impl Debug for WgpuDevice
source§impl Default for WgpuDevice
impl Default for WgpuDevice
source§impl Hash for WgpuDevice
impl Hash for WgpuDevice
source§impl PartialEq for WgpuDevice
impl PartialEq for WgpuDevice
source§fn eq(&self, other: &WgpuDevice) -> bool
fn eq(&self, other: &WgpuDevice) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for WgpuDevice
impl StructuralEq for WgpuDevice
impl StructuralPartialEq for WgpuDevice
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.