#[cfg(target_os = "linux")]
pub mod amd;
#[cfg(target_os = "linux")]
pub mod intel;
#[cfg(target_os = "windows")]
pub mod windows_amd;
#[cfg(target_os = "windows")]
pub mod windows_intel;
#[cfg(target_os = "macos")]
pub mod macos_intel;
#[cfg(feature = "nvidia")]
pub mod nvidia;
use super::HISTORY_LEN;
#[derive(Debug)]
pub struct GpuEntry {
pub name: String,
pub utilization: f32,
pub mem_used: u64,
pub mem_total: u64,
pub mem_is_gtt: bool,
pub temperature: Option<u32>,
pub power_watts: Option<f32>,
pub util_history: Vec<f32>,
pub mem_history: Vec<f32>,
}
impl GpuEntry {
pub fn new(name: String) -> Self {
Self {
name,
utilization: 0.0,
mem_used: 0,
mem_total: 0,
mem_is_gtt: false,
temperature: None,
power_watts: None,
util_history: vec![0.0; HISTORY_LEN],
mem_history: vec![0.0; HISTORY_LEN],
}
}
}