pub struct CpuInfo {
pub model: String,
pub vendor: String,
pub physical_cores: usize,
pub logical_cores: usize,
pub base_frequency_ghz: f64,
pub max_frequency_ghz: f64,
pub cache_l1_kb: usize,
pub cache_l2_kb: usize,
pub cache_l3_kb: usize,
pub simd_capabilities: SimdCapabilities,
pub architecture: CpuArchitecture,
pub features: Vec<String>,
}Expand description
CPU information and capabilities
Fields§
§model: StringCPU model name
vendor: StringCPU vendor
physical_cores: usizeNumber of physical cores
logical_cores: usizeNumber of logical cores (with hyperthreading)
base_frequency_ghz: f64Base frequency in GHz
max_frequency_ghz: f64Maximum frequency in GHz
cache_l1_kb: usizeL1 cache size in KB
cache_l2_kb: usizeL2 cache size in KB
cache_l3_kb: usizeL3 cache size in KB
simd_capabilities: SimdCapabilitiesSIMD instruction set support
architecture: CpuArchitectureCPU architecture
features: Vec<String>Additional features
Implementations§
Source§impl CpuInfo
impl CpuInfo
Sourcepub fn detect() -> CoreResult<Self>
pub fn detect() -> CoreResult<Self>
Detect CPU information
Sourcepub fn performance_score(&self) -> f64
pub fn performance_score(&self) -> f64
Calculate performance score (0.0 to 1.0)
Sourcepub fn optimal_thread_count(&self) -> usize
pub fn optimal_thread_count(&self) -> usize
Get optimal thread count for parallel operations
Sourcepub fn optimal_chunk_size(&self) -> usize
pub fn optimal_chunk_size(&self) -> usize
Get optimal chunk size based on cache hierarchy
Sourcepub fn supports_instruction_set(&self, instructionset: &str) -> bool
pub fn supports_instruction_set(&self, instructionset: &str) -> bool
Check if CPU supports specific instruction set
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CpuInfo
impl RefUnwindSafe for CpuInfo
impl Send for CpuInfo
impl Sync for CpuInfo
impl Unpin for CpuInfo
impl UnwindSafe for CpuInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more