pub struct StridedMutSimd<'a, T: TypeCommon> { /* private fields */ }Expand description
A SIMD-optimized mutable strided iterator over tensor elements.
This struct provides mutable access to tensor elements with SIMD optimizations.
Implementations§
Source§impl<'a, T: CommonBounds> StridedMutSimd<'a, T>
impl<'a, T: CommonBounds> StridedMutSimd<'a, T>
Sourcepub fn new<U: TensorInfo<T>>(tensor: U) -> Self
pub fn new<U: TensorInfo<T>>(tensor: U) -> Self
Creates a new StridedMutSimd instance from a tensor.
This constructor initializes a StridedMutSimd iterator by creating a base StridedSimd
from the provided tensor. It also retrieves the last stride from the base iterator to
configure the strided access pattern. The PhantomData marker is used to associate
the iterator with the tensor’s data type T without holding any actual data.
§Arguments
tensor- An instance that implements theTensorInfo<T>trait, representing the tensor to be iterated over. This tensor provides the necessary information about the tensor’s shape, strides, and data layout.
§Returns
A new instance of StridedMutSimd
Trait Implementations§
Source§impl<'a, T> IterGetSetSimd for StridedMutSimd<'a, T>where
T: CommonBounds + 'a,
impl<'a, T> IterGetSetSimd for StridedMutSimd<'a, T>where
T: CommonBounds + 'a,
Source§type SimdItem = &'a mut <T as TypeCommon>::Vec
type SimdItem = &'a mut <T as TypeCommon>::Vec
The type of the iterator’s simd elements.
Source§fn set_end_index(&mut self, end_index: usize)
fn set_end_index(&mut self, end_index: usize)
set the end index of the iterator, this is used when rayon perform data splitting
Source§fn set_intervals(&mut self, intervals: Arc<Vec<(usize, usize)>>)
fn set_intervals(&mut self, intervals: Arc<Vec<(usize, usize)>>)
set the chunk intervals of the iterator, we chunk the outer loop
Source§fn set_strides(&mut self, strides: Strides)
fn set_strides(&mut self, strides: Strides)
set the strides for the iterator, we call this method normally when we do broadcasting
Source§fn set_shape(&mut self, shape: Shape)
fn set_shape(&mut self, shape: Shape)
set the shape for the iterator, we call this method normally when we do broadcasting
Source§fn broadcast_set_strides(&mut self, shape: &Shape)
fn broadcast_set_strides(&mut self, shape: &Shape)
set the strides for all the iterators
Source§fn outer_loop_size(&self) -> usize
fn outer_loop_size(&self) -> usize
get the outer loop size
Source§fn inner_loop_size(&self) -> usize
fn inner_loop_size(&self) -> usize
get the inner loop size
Source§fn inner_loop_next(&mut self, index: usize) -> Self::Item
fn inner_loop_next(&mut self, index: usize) -> Self::Item
get the next element of the inner loop
Source§fn inner_loop_next_simd(&mut self, index: usize) -> Self::SimdItem
fn inner_loop_next_simd(&mut self, index: usize) -> Self::SimdItem
get the next vector of the inner loop, this is called when we do simd iteration
Source§fn all_last_stride_one(&self) -> bool
fn all_last_stride_one(&self) -> bool
check if all iterators’ last stride is one, only when all iterators’ last stride is one, we can do simd iteration
Source§impl<'a, T> StridedIteratorSimd for StridedMutSimd<'a, T>where
T: CommonBounds,
impl<'a, T> StridedIteratorSimd for StridedMutSimd<'a, T>where
T: CommonBounds,
Source§impl<'a, T> StridedSimdIteratorZip for StridedMutSimd<'a, T>where
T: CommonBounds,
impl<'a, T> StridedSimdIteratorZip for StridedMutSimd<'a, T>where
T: CommonBounds,
Source§fn zip<'a, C>(self, other: C) -> StridedZipSimd<'a, Self, C>where
C: 'a + IterGetSetSimd,
<C as IterGetSetSimd>::Item: Send,
Self: IterGetSetSimd,
<Self as IterGetSetSimd>::Item: Send,
fn zip<'a, C>(self, other: C) -> StridedZipSimd<'a, Self, C>where
C: 'a + IterGetSetSimd,
<C as IterGetSetSimd>::Item: Send,
Self: IterGetSetSimd,
<Self as IterGetSetSimd>::Item: Send,
Combines this iterator with another SIMD-optimized iterator, enabling simultaneous iteration. Read more
Auto Trait Implementations§
impl<'a, T> Freeze for StridedMutSimd<'a, T>
impl<'a, T> RefUnwindSafe for StridedMutSimd<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for StridedMutSimd<'a, T>
impl<'a, T> Sync for StridedMutSimd<'a, T>
impl<'a, T> Unpin for StridedMutSimd<'a, T>
impl<'a, T> UnwindSafe for StridedMutSimd<'a, T>where
T: RefUnwindSafe,
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