Trait IterGetSet

Source
pub trait IterGetSet {
    type Item;

Show 14 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, strides: 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 inner_loop_next(&mut self, index: usize) -> Self::Item;
}
Expand description

A trait for getting and setting values from an iterator.

Required Associated Types§

Source

type Item

The type of the iterator’s 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, 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)

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

Source

fn inner_loop_next(&mut self, index: usize) -> Self::Item

get the next element of the inner loop

Implementors§

Source§

impl<'a, A, B> IterGetSet for ParStridedZip<'a, A, B>
where A: IterGetSet, B: IterGetSet,

Source§

type Item = (<A as IterGetSet>::Item, <B as IterGetSet>::Item)

Source§

impl<'a, A, B> IterGetSet for StridedZip<'a, A, B>
where A: IterGetSet, B: IterGetSet,

Source§

type Item = (<A as IterGetSet>::Item, <B as IterGetSet>::Item)

Source§

impl<'a, T> IterGetSet for ParStridedMut<'a, T>
where T: CommonBounds + 'a,

Source§

impl<'a, T> IterGetSet for StridedMut<'a, T>
where T: CommonBounds + 'a,

Source§

impl<'a, T: 'a + CommonBounds> IterGetSet for ParStridedMapMut<'a, T>

Source§

impl<'a, T: 'a + CommonBounds> IterGetSet for StridedMapMut<'a, T>
where T::Vec: Send,

Source§

impl<T: CommonBounds> IterGetSet for ParStrided<T>

Source§

type Item = T

Source§

impl<T: CommonBounds> IterGetSet for Strided<T>

Source§

type Item = T