pub struct ParStridedMapSimd<'a, I, T: 'a, F, F2>where
I: UnindexedProducer<Item = T> + 'a + IterGetSetSimd<Item = T> + ParallelIterator + ShapeManipulator,{ /* private fields */ }Expand description
A parallel SIMD-optimized map iterator over tensor elements.
This struct allows for applying two separate functions (f and f2) to elements of a tensor
in a SIMD-optimized and parallel manner.
Implementations§
Source§impl<'a, I: UnindexedProducer<Item = T> + 'a + IterGetSetSimd<Item = T> + ParallelIterator + ShapeManipulator, T: 'a, F, F2> ParStridedMapSimd<'a, I, T, F, F2>
impl<'a, I: UnindexedProducer<Item = T> + 'a + IterGetSetSimd<Item = T> + ParallelIterator + ShapeManipulator, T: 'a, F, F2> ParStridedMapSimd<'a, I, T, F, F2>
Sourcepub fn collect<U>(self) -> Uwhere
F: Fn((&mut <U as TensorCreator>::Meta, <I as IterGetSetSimd>::Item)) + Sync + Send + 'a,
U: Clone + TensorInfo<U::Meta> + TensorCreator<Output = U>,
<I as IterGetSetSimd>::Item: Send,
<U as TensorCreator>::Meta: CommonBounds,
F2: Send + Sync + Copy + Fn((MutVec<'_, <<U as TensorCreator>::Meta as TypeCommon>::Vec>, <I as IterGetSetSimd>::SimdItem)),
pub fn collect<U>(self) -> Uwhere
F: Fn((&mut <U as TensorCreator>::Meta, <I as IterGetSetSimd>::Item)) + Sync + Send + 'a,
U: Clone + TensorInfo<U::Meta> + TensorCreator<Output = U>,
<I as IterGetSetSimd>::Item: Send,
<U as TensorCreator>::Meta: CommonBounds,
F2: Send + Sync + Copy + Fn((MutVec<'_, <<U as TensorCreator>::Meta as TypeCommon>::Vec>, <I as IterGetSetSimd>::SimdItem)),
Collects the results of the map operation into a new tensor.
This method applies the provided functions f and f2 to each element and SIMD item
respectively, accumulating the results into a new tensor of type U.
§Type Parameters
U- The type of the tensor to collect the results into. Must implementTensorAlloc,Clone, andTensorInfo.
§Arguments
self- TheParStridedMapSimditerator instance.
§Returns
A new tensor of type U containing the results of the map operation.
Trait Implementations§
Source§impl<'a, I, T: Clone + 'a, F: Clone, F2: Clone> Clone for ParStridedMapSimd<'a, I, T, F, F2>where
I: UnindexedProducer<Item = T> + 'a + IterGetSetSimd<Item = T> + ParallelIterator + ShapeManipulator + Clone,
impl<'a, I, T: Clone + 'a, F: Clone, F2: Clone> Clone for ParStridedMapSimd<'a, I, T, F, F2>where
I: UnindexedProducer<Item = T> + 'a + IterGetSetSimd<Item = T> + ParallelIterator + ShapeManipulator + Clone,
Source§fn clone(&self) -> ParStridedMapSimd<'a, I, T, F, F2>
fn clone(&self) -> ParStridedMapSimd<'a, I, T, F, F2>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<'a, I, T, F, F2> Freeze for ParStridedMapSimd<'a, I, T, F, F2>
impl<'a, I, T, F, F2> RefUnwindSafe for ParStridedMapSimd<'a, I, T, F, F2>
impl<'a, I, T, F, F2> Send for ParStridedMapSimd<'a, I, T, F, F2>
impl<'a, I, T, F, F2> Sync for ParStridedMapSimd<'a, I, T, F, F2>
impl<'a, I, T, F, F2> Unpin for ParStridedMapSimd<'a, I, T, F, F2>
impl<'a, I, T, F, F2> UnwindSafe for ParStridedMapSimd<'a, I, T, F, F2>
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