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
Associated Constants
Required Methods
fn load(data: &[Self::Scalar], offset: usize) -> Self
Create a new vector with Self::WIDTH
elements from data
, beginning
at offset
.
unsafe fn load_unchecked(data: &[Self::Scalar], offset: usize) -> Self
Create a new vector with Self::WIDTH
elements from data
, beginning
at offset
, without asserting length of data.
fn store(self, data: &mut [Self::Scalar], offset: usize)
Write Self::WIDTH
elements from this vector to data
, beginning at
offset
.
fn coalesce(self) -> Self::Scalar
Assert all elements of the vector are equal, then return the
element. Opposiite operation of Self::splat
.
fn splat(data: Self::Scalar) -> Self
Return a vector with all elements initialized to data
. Opposite
operation for Self::coalesce
.
fn default() -> Self
Return a vector with all elements initialized to the default value for the underlying element type.
fn extract(&self, idx: usize) -> Self::Scalar
Return the idx
th element of this vector.
fn replace(&mut self, idx: usize, data: Self::Scalar) -> Self
Replace the idx
th element of this vector with data
.
fn sum(&self) -> Self::Scalar
Return a scalar equivalent to the sum of all elements of this vector.
fn product(&self) -> Self::Scalar
Return a scalar equivalent to the product of all elements of this vector.
fn scalar_reduce<T, F>(&self, acc: T, func: F) -> T where
F: FnMut(T, Self::Scalar) -> T,
F: FnMut(T, Self::Scalar) -> T,
Return the result of a scalar reduction over this vector
Provided Methods
Implementors
impl Packed for u8x64 type Scalar = u8;
impl Packed for u8x32 type Scalar = u8;
impl Packed for u8x16 type Scalar = u8;
impl Packed for i8x64 type Scalar = i8;
impl Packed for i8x32 type Scalar = i8;
impl Packed for i8x16 type Scalar = i8;
impl Packed for u16x32 type Scalar = u16;
impl Packed for u16x16 type Scalar = u16;
impl Packed for u16x8 type Scalar = u16;
impl Packed for i16x32 type Scalar = i16;
impl Packed for i16x16 type Scalar = i16;
impl Packed for i16x8 type Scalar = i16;
impl Packed for u32x16 type Scalar = u32;
impl Packed for u32x8 type Scalar = u32;
impl Packed for u32x4 type Scalar = u32;
impl Packed for i32x16 type Scalar = i32;
impl Packed for i32x8 type Scalar = i32;
impl Packed for i32x4 type Scalar = i32;
impl Packed for f32x16 type Scalar = f32;
impl Packed for f32x8 type Scalar = f32;
impl Packed for f32x4 type Scalar = f32;
impl Packed for u64x8 type Scalar = u64;
impl Packed for u64x4 type Scalar = u64;
impl Packed for u64x2 type Scalar = u64;
impl Packed for i64x8 type Scalar = i64;
impl Packed for i64x4 type Scalar = i64;
impl Packed for i64x2 type Scalar = i64;
impl Packed for f64x8 type Scalar = f64;
impl Packed for f64x4 type Scalar = f64;
impl Packed for f64x2 type Scalar = f64;