pub struct CacheOptimizer { /* private fields */ }Expand description
Cache line size detection and alignment utilities
Implementations§
Source§impl CacheOptimizer
impl CacheOptimizer
Sourcepub fn get_optimal_alignment(&self, data_size: usize) -> usize
pub fn get_optimal_alignment(&self, data_size: usize) -> usize
Get optimal alignment for data structures
Sourcepub fn get_optimal_block_size(
&self,
element_size: usize,
total_elements: usize,
) -> usize
pub fn get_optimal_block_size( &self, element_size: usize, total_elements: usize, ) -> usize
Calculate optimal block size for cache-friendly iteration
Sourcepub fn optimize_access_pattern(
&self,
dims: &[usize],
element_size: usize,
) -> AccessPattern
pub fn optimize_access_pattern( &self, dims: &[usize], element_size: usize, ) -> AccessPattern
Suggest memory access pattern optimization
Sourcepub fn cache_line_size(&self) -> usize
pub fn cache_line_size(&self) -> usize
Get cache line size
Sourcepub fn l1_cache_size(&self) -> usize
pub fn l1_cache_size(&self) -> usize
Get L1 cache size
Sourcepub fn l2_cache_size(&self) -> usize
pub fn l2_cache_size(&self) -> usize
Get L2 cache size
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CacheOptimizer
impl RefUnwindSafe for CacheOptimizer
impl Send for CacheOptimizer
impl Sync for CacheOptimizer
impl Unpin for CacheOptimizer
impl UnsafeUnpin for CacheOptimizer
impl UnwindSafe for CacheOptimizer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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