pub enum DevicePreference {
Auto,
Cpu,
Gpu,
DeviceIndex(u32),
}Expand description
Where the host prefers to run a model.
Step 1 only records intent. Real ONNX/CUDA selection lands behind onnx
(or a host-private runtime crate) in a later step.
Variants§
Auto
Let the runtime choose.
Cpu
Force CPU.
Gpu
Prefer discrete / integrated GPU when available.
DeviceIndex(u32)
Explicit device index (runtime-defined).
Implementations§
Trait Implementations§
Source§impl Clone for DevicePreference
impl Clone for DevicePreference
impl Copy for DevicePreference
Source§impl Debug for DevicePreference
impl Debug for DevicePreference
Source§impl Default for DevicePreference
impl Default for DevicePreference
Source§impl<'de> Deserialize<'de> for DevicePreference
impl<'de> Deserialize<'de> for DevicePreference
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for DevicePreference
Source§impl PartialEq for DevicePreference
impl PartialEq for DevicePreference
Source§impl Serialize for DevicePreference
impl Serialize for DevicePreference
impl StructuralPartialEq for DevicePreference
Auto Trait Implementations§
impl Freeze for DevicePreference
impl RefUnwindSafe for DevicePreference
impl Send for DevicePreference
impl Sync for DevicePreference
impl Unpin for DevicePreference
impl UnsafeUnpin for DevicePreference
impl UnwindSafe for DevicePreference
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