pub struct AccessTracker { /* private fields */ }Expand description
Access pattern tracker for a tensor
Implementations§
Source§impl AccessTracker
impl AccessTracker
Sourcepub fn new(shape: Shape, memory_format: MemoryFormat) -> Self
pub fn new(shape: Shape, memory_format: MemoryFormat) -> Self
Create a new access tracker
Sourcepub fn with_cache_line_size(self, cache_line_size: usize) -> Self
pub fn with_cache_line_size(self, cache_line_size: usize) -> Self
Create with custom cache line size
Sourcepub fn record_access(&mut self, linear_index: usize)
pub fn record_access(&mut self, linear_index: usize)
Record a memory access
Sourcepub fn statistics(&self) -> &AccessStatistics
pub fn statistics(&self) -> &AccessStatistics
Get current statistics
Sourcepub fn cache_hit_rate(&self) -> f64
pub fn cache_hit_rate(&self) -> f64
Get cache hit rate
Trait Implementations§
Source§impl Clone for AccessTracker
impl Clone for AccessTracker
Source§fn clone(&self) -> AccessTracker
fn clone(&self) -> AccessTracker
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 moreAuto Trait Implementations§
impl !Freeze for AccessTracker
impl RefUnwindSafe for AccessTracker
impl Send for AccessTracker
impl Sync for AccessTracker
impl Unpin for AccessTracker
impl UnsafeUnpin for AccessTracker
impl UnwindSafe for AccessTracker
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