//! Device preference for host inference (CPU / GPU / auto).
useserde::{Deserialize, Serialize};/// 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.
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]#[serde(rename_all ="snake_case")]pubenumDevicePreference{/// Let the runtime choose.
#[default]
Auto,/// Force CPU.
Cpu,/// Prefer discrete / integrated GPU when available.
Gpu,/// Explicit device index (runtime-defined).
DeviceIndex(u32),}implDevicePreference{/// Human-readable label for logs / metrics.
#[must_use]pubconstfnas_str(self)->&'staticstr{matchself{Self::Auto =>"auto",Self::Cpu =>"cpu",Self::Gpu =>"gpu",Self::DeviceIndex(_)=>"device_index",}}}