pub struct DeviceInfo {
pub cpu_cores: u32,
pub total_memory: u64,
pub os_type: String,
pub os_release: String,
pub has_cuda: bool,
pub has_metal: bool,
pub has_rocm: bool,
pub has_directml: bool,
pub devices: Vec<Device>,
}Fields§
§cpu_cores: u32§total_memory: u64§os_type: String§os_release: String§has_cuda: bool§has_metal: bool§has_rocm: bool§has_directml: bool§devices: Vec<Device>Implementations§
Source§impl DeviceInfo
impl DeviceInfo
Sourcepub fn try_probe() -> Result<Self, DeviceProbeError>
pub fn try_probe() -> Result<Self, DeviceProbeError>
Probe device information (not cached).
Sourcepub fn try_probe_with_timeout(
timeout: Duration,
) -> Result<Self, DeviceProbeError>
pub fn try_probe_with_timeout( timeout: Duration, ) -> Result<Self, DeviceProbeError>
Probe device information with a timeout applied to external commands.
Sourcepub fn best_gpu(&self) -> Option<&Device>
pub fn best_gpu(&self) -> Option<&Device>
Select the “best” GPU using a simple heuristic.
Primary key: memory_mb.
Tie-breaker: compute_capability when present.
pub fn best_gpu_with_preference( &self, preference: &GpuPreference, ) -> Option<&Device>
pub fn cuda_devices(&self) -> Vec<&Device>
Sourcepub fn get_best_provider(&self) -> String
pub fn get_best_provider(&self) -> String
Get the best available execution provider.
Sourcepub fn has_provider(&self, provider: &str) -> bool
pub fn has_provider(&self, provider: &str) -> bool
Check if a specific provider is available.
Trait Implementations§
Source§impl Clone for DeviceInfo
impl Clone for DeviceInfo
Source§fn clone(&self) -> DeviceInfo
fn clone(&self) -> DeviceInfo
Returns a duplicate 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 DeviceInfo
impl Debug for DeviceInfo
Source§impl<'de> Deserialize<'de> for DeviceInfo
impl<'de> Deserialize<'de> for DeviceInfo
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
Auto Trait Implementations§
impl Freeze for DeviceInfo
impl RefUnwindSafe for DeviceInfo
impl Send for DeviceInfo
impl Sync for DeviceInfo
impl Unpin for DeviceInfo
impl UnsafeUnpin for DeviceInfo
impl UnwindSafe for DeviceInfo
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