Trait IterGetSetSimd

Source
pub trait IterGetSetSimd {
    type Item;
    type SimdItem;

Show 18 methods // Required methods fn set_end_index(&mut self, end_index: usize); fn set_intervals(&mut self, intervals: Arc<Vec<(usize, usize)>>); fn set_strides(&mut self, last_stride: Strides); fn set_shape(&mut self, shape: Shape); fn set_prg(&mut self, prg: Vec<i64>); fn intervals(&self) -> &Arc<Vec<(usize, usize)>>; fn strides(&self) -> &Strides; fn shape(&self) -> &Shape; fn layout(&self) -> &Layout; fn broadcast_set_strides(&mut self, shape: &Shape); fn outer_loop_size(&self) -> usize; fn inner_loop_size(&self) -> usize; fn next(&mut self); fn next_simd(&mut self); fn inner_loop_next(&mut self, index: usize) -> Self::Item; fn inner_loop_next_simd(&mut self, index: usize) -> Self::SimdItem; fn all_last_stride_one(&self) -> bool; fn lanes(&self) -> Option<usize>;
}
Expand description

A trait for getting and setting values from an simd iterator

Required Associated Types§

Source

type Item

The type of the iterator’s elements.

Source

type SimdItem

The type of the iterator’s simd elements.

Required Methods§

Source

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)>>)

set the chunk intervals of the iterator, we chunk the outer loop

Source

fn set_strides(&mut self, last_stride: Strides)

set the strides for the iterator, we call this method normally when we do broadcasting

Source

fn set_shape(&mut self, shape: Shape)

set the shape for the iterator, we call this method normally when we do broadcasting

Source

fn set_prg(&mut self, prg: Vec<i64>)

set the loop progress for the iterator

Source

fn intervals(&self) -> &Arc<Vec<(usize, usize)>>

get the intervals of the iterator

Source

fn strides(&self) -> &Strides

get the strides of the iterator

Source

fn shape(&self) -> &Shape

get the shape of the iterator

Source

fn layout(&self) -> &Layout

get the layout of the iterator

Source

fn broadcast_set_strides(&mut self, shape: &Shape)

set the strides for all the iterators

Source

fn outer_loop_size(&self) -> usize

get the outer loop size

Source

fn inner_loop_size(&self) -> usize

get the inner loop size

Source

fn next(&mut self)

update the loop progress, this is called when we don’t do simd iteration

Source

fn next_simd(&mut self)

update the loop progress, this is called when we do simd iteration

Source

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

get the next vector of the inner loop, this is called when we do simd iteration

Source

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

fn lanes(&self) -> Option<usize>

get the simd vector size, if any of the iterator returned different vector size, it will return None

Implementors§

Source§

impl<'a, A, B> IterGetSetSimd for ParStridedZipSimd<'a, A, B>

Source§

impl<'a, A, B> IterGetSetSimd for StridedZipSimd<'a, A, B>

Source§

impl<'a, T> IterGetSetSimd for ParStridedMutSimd<'a, T>
where T: CommonBounds + 'a, T::Vec: Send,

Source§

type Item = &'a mut T

Source§

type SimdItem = MutVec<'a, <T as TypeCommon>::Vec> where Self: 'a

Source§

impl<'a, T> IterGetSetSimd for StridedMutSimd<'a, T>
where T: CommonBounds + 'a,

Source§

impl<'a, T: 'a + CommonBounds> IterGetSetSimd for ParStridedMapMutSimd<'a, T>
where T::Vec: Send,

Source§

impl<'a, T: 'a + CommonBounds> IterGetSetSimd for StridedMapMutSimd<'a, T>
where T::Vec: Send,

Source§

impl<T: CommonBounds> IterGetSetSimd for ParStridedSimd<T>
where T::Vec: Send,

Source§

impl<T: CommonBounds> IterGetSetSimd for StridedSimd<T>