SimdIterable

Trait SimdIterable 

Source
pub trait SimdIterable {
    type Elem: Elem;

    // Required methods
    fn simd_iter<O: NumOps<Self::Elem>>(
        &self,
        ops: O,
    ) -> Iter<'_, Self::Elem, O> ;
    fn simd_iter_pad<O: NumOps<Self::Elem>>(
        &self,
        ops: O,
    ) -> impl ExactSizeIterator<Item = O::Simd>;
}
Expand description

Methods for creating vectorized iterators.

Required Associated Types§

Source

type Elem: Elem

Element type in the slice.

Required Methods§

Source

fn simd_iter<O: NumOps<Self::Elem>>(&self, ops: O) -> Iter<'_, Self::Elem, O>

Iterate over SIMD-sized chunks of the input.

If the input length is not divisble by the SIMD vector width, the iterator yields only the full chunks. The tail is accessible via the iterator’s tail method.

Source

fn simd_iter_pad<O: NumOps<Self::Elem>>( &self, ops: O, ) -> impl ExactSizeIterator<Item = O::Simd>

Iterate over SIMD-sized chunks of the input.

If the input length is not divisble by the SIMD vector width, the final chunk will be padded with zeros.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Elem> SimdIterable for [T]

Source§

type Elem = T

Source§

fn simd_iter<O: NumOps<T>>(&self, ops: O) -> Iter<'_, T, O>

Source§

fn simd_iter_pad<O: NumOps<T>>( &self, ops: O, ) -> impl ExactSizeIterator<Item = O::Simd>

Implementors§