pub struct StridedMapMutSimd<'a, T>{ /* private fields */ }Expand description
A SIMD-optimized mutable mapped strided iterator over tensor elements.
This struct provides mutable access to tensor elements with SIMD optimizations, allowing for efficient parallel processing of tensor data.
Implementations§
Source§impl<'a, T> StridedMapMutSimd<'a, T>
impl<'a, T> StridedMapMutSimd<'a, T>
Sourcepub fn new<U: TensorInfo<T>>(res_tensor: U) -> Self
pub fn new<U: TensorInfo<T>>(res_tensor: U) -> Self
Trait Implementations§
Source§impl<'a, T: 'a + CommonBounds> IterGetSetSimd for StridedMapMutSimd<'a, T>
impl<'a, T: 'a + CommonBounds> IterGetSetSimd for StridedMapMutSimd<'a, T>
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, _: usize)
fn set_end_index(&mut self, _: usize)
set the end index of the iterator, this is used when rayon perform data splitting
Source§fn set_intervals(&mut self, _: Arc<Vec<(usize, usize)>>)
fn set_intervals(&mut self, _: 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, _: usize) -> Self::SimdItem
fn inner_loop_next_simd(&mut self, _: 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 StridedMapMutSimd<'a, T>where
T: 'a + CommonBounds,
impl<'a, T> StridedIteratorSimd for StridedMapMutSimd<'a, T>where
T: 'a + CommonBounds,
Auto Trait Implementations§
impl<'a, T> Freeze for StridedMapMutSimd<'a, T>
impl<'a, T> RefUnwindSafe for StridedMapMutSimd<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for StridedMapMutSimd<'a, T>
impl<'a, T> Sync for StridedMapMutSimd<'a, T>
impl<'a, T> Unpin for StridedMapMutSimd<'a, T>
impl<'a, T> UnwindSafe for StridedMapMutSimd<'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