pub struct LayoutOptimizer { /* private fields */ }Expand description
Layout optimizer that analyzes access patterns and recommends layouts
Implementations§
Source§impl LayoutOptimizer
impl LayoutOptimizer
Sourcepub fn with_threshold(self, threshold: f64) -> Self
pub fn with_threshold(self, threshold: f64) -> Self
Create with custom optimization threshold
Sourcepub fn aggressive(self, enabled: bool) -> Self
pub fn aggressive(self, enabled: bool) -> Self
Enable aggressive optimizations (may use more memory)
Sourcepub fn register_tensor(
&mut self,
tensor_id: usize,
shape: Shape,
format: MemoryFormat,
)
pub fn register_tensor( &mut self, tensor_id: usize, shape: Shape, format: MemoryFormat, )
Register a tensor for tracking
Sourcepub fn record_access(
&mut self,
tensor_id: usize,
linear_index: usize,
) -> Result<()>
pub fn record_access( &mut self, tensor_id: usize, linear_index: usize, ) -> Result<()>
Record an access for a tensor
Sourcepub fn recommend_layout(
&self,
tensor_id: usize,
) -> Result<Option<LayoutRecommendation>>
pub fn recommend_layout( &self, tensor_id: usize, ) -> Result<Option<LayoutRecommendation>>
Get optimization recommendation for a tensor
Sourcepub fn tracked_tensors(&self) -> Vec<usize>
pub fn tracked_tensors(&self) -> Vec<usize>
Get all tracked tensor IDs
Sourcepub fn get_statistics(&self, tensor_id: usize) -> Result<AccessStatistics>
pub fn get_statistics(&self, tensor_id: usize) -> Result<AccessStatistics>
Get statistics for a tensor
Sourcepub fn clear_tensor(&mut self, tensor_id: usize)
pub fn clear_tensor(&mut self, tensor_id: usize)
Clear tracking data for a tensor
Trait Implementations§
Source§impl Debug for LayoutOptimizer
impl Debug for LayoutOptimizer
Auto Trait Implementations§
impl Freeze for LayoutOptimizer
impl RefUnwindSafe for LayoutOptimizer
impl Send for LayoutOptimizer
impl Sync for LayoutOptimizer
impl Unpin for LayoutOptimizer
impl UnsafeUnpin for LayoutOptimizer
impl UnwindSafe for LayoutOptimizer
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> 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