pub struct StridedSimd<T: TypeCommon> { /* private fields */ }Expand description
A single thread SIMD-optimized strided iterator
Implementations§
Source§impl<T: CommonBounds> StridedSimd<T>
impl<T: CommonBounds> StridedSimd<T>
Sourcepub fn shape(&self) -> &Shape
pub fn shape(&self) -> &Shape
Retrieves the shape of the tensor.
§Returns
A reference to the Shape struct representing the tensor’s dimensions.
Sourcepub fn strides(&self) -> &Strides
pub fn strides(&self) -> &Strides
Retrieves the strides of the tensor.
§Returns
A reference to the Strides struct representing the tensor’s stride information.
Sourcepub fn new<U: TensorInfo<T>>(tensor: U) -> Self
pub fn new<U: TensorInfo<T>>(tensor: U) -> Self
Trait Implementations§
Source§impl<T: Clone + TypeCommon> Clone for StridedSimd<T>
impl<T: Clone + TypeCommon> Clone for StridedSimd<T>
Source§fn clone(&self) -> StridedSimd<T>
fn clone(&self) -> StridedSimd<T>
Returns a copy 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 moreSource§impl<T: CommonBounds> IterGetSetSimd for StridedSimd<T>
impl<T: CommonBounds> IterGetSetSimd for StridedSimd<T>
Source§type SimdItem = <T as TypeCommon>::Vec
type SimdItem = <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, 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<T: CommonBounds> ShapeManipulator for StridedSimd<T>
impl<T: CommonBounds> ShapeManipulator for StridedSimd<T>
Source§impl<T> StridedIteratorSimd for StridedSimd<T>where
T: CommonBounds,
impl<T> StridedIteratorSimd for StridedSimd<T>where
T: CommonBounds,
Source§impl<T: CommonBounds> StridedSimdIteratorZip for StridedSimd<T>
impl<T: CommonBounds> StridedSimdIteratorZip for StridedSimd<T>
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
impl<T: CommonBounds> StridedIteratorMap for StridedSimd<T>
Auto Trait Implementations§
impl<T> Freeze for StridedSimd<T>
impl<T> RefUnwindSafe for StridedSimd<T>where
T: RefUnwindSafe,
impl<T> Send for StridedSimd<T>
impl<T> Sync for StridedSimd<T>
impl<T> Unpin for StridedSimd<T>
impl<T> UnwindSafe for StridedSimd<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> 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