pub enum Device {
Cpu,
Gpu {
index: usize,
},
}Expand description
想用的设备。配置 [gpu] mode 的对应:off → Cpu,cuda → Gpu { index: 0 },
cuda:N → Gpu { index: N };auto 也是 Gpu { index: 0 },打不开时退回 CPU。
Variants§
Trait Implementations§
impl Copy for Device
impl Eq for Device
impl StructuralPartialEq for Device
Auto Trait Implementations§
impl Forget for Device
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