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: String
CPU model name
vendor: String
CPU vendor
physical_cores: usize
Number of physical cores
logical_cores: usize
Number of logical cores (with hyperthreading)
base_frequency_ghz: f64
Base frequency in GHz
max_frequency_ghz: f64
Maximum frequency in GHz
cache_l1_kb: usize
L1 cache size in KB
cache_l2_kb: usize
L2 cache size in KB
cache_l3_kb: usize
L3 cache size in KB
simd_capabilities: SimdCapabilities
SIMD instruction set support
architecture: CpuArchitecture
CPU 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