pub struct CacheConfig {
pub l1_size_kb: usize,
pub l2_size_kb: usize,
pub l3_size_kb: usize,
pub cache_line_size: usize,
pub associativity: usize,
pub enable_tiling: bool,
pub enable_prefetch: bool,
pub prefetch_distance: usize,
pub enable_layout_optimization: bool,
}Expand description
Cache configuration.
Fields§
§l1_size_kb: usizeL1 cache size (KB)
l2_size_kb: usizeL2 cache size (KB)
l3_size_kb: usizeL3 cache size (KB)
cache_line_size: usizeCache line size (bytes)
associativity: usizeCache associativity
enable_tiling: boolEnable loop tiling
enable_prefetch: boolEnable prefetching
prefetch_distance: usizePrefetch distance (cache lines)
enable_layout_optimization: boolEnable data layout optimization
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn from_system() -> Self
pub fn from_system() -> Self
Detect cache configuration from system.
Sourcepub fn with_l1_size(self, size_kb: usize) -> Self
pub fn with_l1_size(self, size_kb: usize) -> Self
Set L1 cache size.
Sourcepub fn with_l2_size(self, size_kb: usize) -> Self
pub fn with_l2_size(self, size_kb: usize) -> Self
Set L2 cache size.
Sourcepub fn with_l3_size(self, size_kb: usize) -> Self
pub fn with_l3_size(self, size_kb: usize) -> Self
Set L3 cache size.
Sourcepub fn with_tiling_enabled(self, enabled: bool) -> Self
pub fn with_tiling_enabled(self, enabled: bool) -> Self
Enable or disable tiling.
Sourcepub fn with_prefetch_enabled(self, enabled: bool) -> Self
pub fn with_prefetch_enabled(self, enabled: bool) -> Self
Enable or disable prefetching.
Sourcepub fn with_prefetch_distance(self, distance: usize) -> Self
pub fn with_prefetch_distance(self, distance: usize) -> Self
Set prefetch distance.
Sourcepub fn total_size_kb(&self) -> usize
pub fn total_size_kb(&self) -> usize
Get total cache size (KB).
Trait Implementations§
Source§impl Clone for CacheConfig
impl Clone for CacheConfig
Source§fn clone(&self) -> CacheConfig
fn clone(&self) -> CacheConfig
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 CacheConfig
impl Debug for CacheConfig
Source§impl Default for CacheConfig
impl Default for CacheConfig
Source§impl<'de> Deserialize<'de> for CacheConfig
impl<'de> Deserialize<'de> for CacheConfig
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
Source§impl PartialEq for CacheConfig
impl PartialEq for CacheConfig
Source§impl Serialize for CacheConfig
impl Serialize for CacheConfig
impl StructuralPartialEq for CacheConfig
Auto Trait Implementations§
impl Freeze for CacheConfig
impl RefUnwindSafe for CacheConfig
impl Send for CacheConfig
impl Sync for CacheConfig
impl Unpin for CacheConfig
impl UnwindSafe for CacheConfig
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