pub struct CacheConfig {
pub l1_cache_size: usize,
pub l2_cache_size: usize,
pub l3_cache_size: usize,
pub cache_line_size: usize,
pub block_size: usize,
pub enable_prefetching: bool,
pub prefetch_distance: usize,
}Expand description
Cache configuration parameters for memory-aware optimizers.
Fields§
§l1_cache_size: usizeL1 cache size in bytes (typically 32KB)
l2_cache_size: usizeL2 cache size in bytes (typically 256KB-1MB)
l3_cache_size: usizeL3 cache size in bytes (typically 8MB-32MB)
cache_line_size: usizeCache line size in bytes (typically 64 bytes)
block_size: usizeBlock size for tiled operations
enable_prefetching: boolWhether to enable prefetching
prefetch_distance: usizePrefetch distance (number of cache lines ahead)
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn detect_system() -> Self
pub fn detect_system() -> Self
Detects cache configuration from the system (simplified version).
Sourcepub fn l1_optimized() -> Self
pub fn l1_optimized() -> Self
Configures for L1 cache optimization (small blocks, high frequency access).
Sourcepub fn l2_optimized() -> Self
pub fn l2_optimized() -> Self
Configures for L2 cache optimization (medium blocks).
Sourcepub fn l3_optimized() -> Self
pub fn l3_optimized() -> Self
Configures for L3 cache optimization (larger blocks).
Sourcepub fn optimal_block_size_for_arrays(&self, num_arrays: usize) -> usize
pub fn optimal_block_size_for_arrays(&self, num_arrays: usize) -> usize
Calculates optimal block size based on cache hierarchy.
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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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