Trait faster::vecs::Packed [] [src]

pub trait Packed: Sized + Copy + Debug + PackedMerge {
    type Scalar: Packable;

    const WIDTH: usize;

    fn load(data: &[Self::Scalar], offset: usize) -> Self;
unsafe fn load_unchecked(data: &[Self::Scalar], offset: usize) -> Self;
fn store(self, data: &mut [Self::Scalar], offset: usize);
fn coalesce(self) -> Self::Scalar;
fn splat(data: Self::Scalar) -> Self;
fn default() -> Self;
fn extract(&self, idx: usize) -> Self::Scalar;
fn replace(&mut self, idx: usize, data: Self::Scalar) -> Self;
fn sum(&self) -> Self::Scalar;
fn product(&self) -> Self::Scalar;
fn scalar_reduce<T, F>(&self, acc: T, func: F) -> T
    where
        F: FnMut(T, Self::Scalar) -> T
; fn width(&self) -> usize { ... } }

A SIMD vector of some type.

Associated Types

The type which fits into this SIMD vector

Associated Constants

The number of elements in this vector

Required Methods

Create a new vector with Self::WIDTH elements from data, beginning at offset.

Create a new vector with Self::WIDTH elements from data, beginning at offset, without asserting length of data.

Write Self::WIDTH elements from this vector to data, beginning at offset.

Assert all elements of the vector are equal, then return the element. Opposiite operation of Self::splat.

Return a vector with all elements initialized to data. Opposite operation for Self::coalesce.

Return a vector with all elements initialized to the default value for the underlying element type.

Return the idxth element of this vector.

Replace the idxth element of this vector with data.

Return a scalar equivalent to the sum of all elements of this vector.

Return a scalar equivalent to the product of all elements of this vector.

Return the result of a scalar reduction over this vector

Provided Methods

Return the number of elements in this vector

Implementors