pub struct OptimizationHints;Expand description
Compile-time optimization hints for SIMD operations
Implementations§
Source§impl OptimizationHints
impl OptimizationHints
Sourcepub fn assume_aligned<T>(ptr: *const T, align: usize) -> *const T
pub fn assume_aligned<T>(ptr: *const T, align: usize) -> *const T
Hint that a pointer is aligned to SIMD boundaries
Sourcepub fn assume_aligned_mut<T>(ptr: *mut T, align: usize) -> *mut T
pub fn assume_aligned_mut<T>(ptr: *mut T, align: usize) -> *mut T
Hint that a pointer is aligned to SIMD boundaries (mutable)
Sourcepub fn assume_range<T: PartialOrd + Copy>(value: T, min: T, max: T) -> T
pub fn assume_range<T: PartialOrd + Copy>(value: T, min: T, max: T) -> T
Hint that a value is within a specific range
Sourcepub fn assume_len<T>(slice: &[T], len: usize) -> &[T]
pub fn assume_len<T>(slice: &[T], len: usize) -> &[T]
Hint that a slice has a specific length
Sourcepub fn assume_len_mut<T>(slice: &mut [T], len: usize) -> &mut [T]
pub fn assume_len_mut<T>(slice: &mut [T], len: usize) -> &mut [T]
Hint that a slice has a specific length (mutable)
Sourcepub fn assume_loop_count(count: usize) -> usize
pub fn assume_loop_count(count: usize) -> usize
Hint that a loop will iterate a specific number of times
Sourcepub fn prefetch_read<T>(_ptr: *const T)
pub fn prefetch_read<T>(_ptr: *const T)
Hint that data is hot (frequently accessed)
Sourcepub fn prefetch_write<T>(_ptr: *const T)
pub fn prefetch_write<T>(_ptr: *const T)
Hint that data will be written to (for write prefetching)
Sourcepub fn prefetch_nta<T>(_ptr: *const T)
pub fn prefetch_nta<T>(_ptr: *const T)
Hint that memory access will be non-temporal
Sourcepub fn assume_noalias<T>(ptr1: *const T, ptr2: *const T, len: usize) -> bool
pub fn assume_noalias<T>(ptr1: *const T, ptr2: *const T, len: usize) -> bool
Hint for vectorization - assume no aliasing
Sourcepub fn optimal_simd_width<T>() -> usize
pub fn optimal_simd_width<T>() -> usize
Hint for SIMD width optimization
Auto Trait Implementations§
impl Freeze for OptimizationHints
impl RefUnwindSafe for OptimizationHints
impl Send for OptimizationHints
impl Sync for OptimizationHints
impl Unpin for OptimizationHints
impl UnsafeUnpin for OptimizationHints
impl UnwindSafe for OptimizationHints
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