SimdFor

Struct SimdFor 

Source
pub struct SimdFor<T, S> {
    pub simd: S,
    /* private fields */
}
Expand description

A simplified wrapper to call into Simd operations in a type and architecture independent way.

Fields§

§simd: S

Architecture specific Simd information.

Implementations§

Source§

impl<T: RlstSimd, S: Simd> SimdFor<T, S>

Source

pub fn new(simd: S) -> Self

Instantiate a new Simd object.

Source

pub fn simd_vector_width(self) -> usize

Length of a Simd vector.

Source

pub fn splat(self, value: T) -> T::Scalars<S>

Copy a scalar across all Simd lanes.

Source

pub fn cmp_eq(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Mask<S>

Compare for equality.

Source

pub fn cmp_lt(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Mask<S>

Compare for less than.

Source

pub fn cmp_le(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Mask<S>

Compare for less equal.

Source

pub fn select( self, mask: T::Mask<S>, if_true: T::Scalars<S>, if_false: T::Scalars<S>, ) -> T::Scalars<S>

Select based on bitmask.

Source

pub fn neg(self, value: T::Scalars<S>) -> T::Scalars<S>

Negate input.

Source

pub fn add(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>

Add two Simd vectors.

Source

pub fn sub(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>

Subtract two Simd vectors.

Source

pub fn mul(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>

Multiply two Simd vectors.

Source

pub fn mul_add( self, lhs: T::Scalars<S>, rhs: T::Scalars<S>, acc: T::Scalars<S>, ) -> T::Scalars<S>

Multiply lhs and rhs and add to acc.

Source

pub fn div(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>

Divide two Simd vectors.

Source

pub fn sin_cos(self, value: T::Scalars<S>) -> (T::Scalars<S>, T::Scalars<S>)

Compute the sine and cosine of two Simd vectors.

Source

pub fn exp(self, value: T::Scalars<S>) -> T::Scalars<S>

Compute the base e exponential of a Simd vector.

Source

pub fn sqrt(self, value: T::Scalars<S>) -> T::Scalars<S>

Compute the square root of a Simd vector.

Source

pub fn approx_recip(self, value: T::Scalars<S>) -> T::Scalars<S>

Compute an approximate inverse of a Simd vector.

Source

pub fn approx_recip_sqrt(self, value: T::Scalars<S>) -> T::Scalars<S>

Compute an approximate inverse of a Simd vector.

Source

pub fn reduce_add(self, value: T::Scalars<S>) -> T

Sum the elements of a Simd vector.

Source

pub fn deinterleave<const N: usize>( self, value: [T::Scalars<S>; N], ) -> [T::Scalars<S>; N]

Deinterleave N Simd vectors.

Source

pub fn interleave<const N: usize>( self, value: [T::Scalars<S>; N], ) -> [T::Scalars<S>; N]

Interleave N Simd vectors.

Trait Implementations§

Source§

impl<T: Clone, S: Clone> Clone for SimdFor<T, S>

Source§

fn clone(&self) -> SimdFor<T, S>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, S: Debug> Debug for SimdFor<T, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Copy, S: Copy> Copy for SimdFor<T, S>

Auto Trait Implementations§

§

impl<T, S> Freeze for SimdFor<T, S>
where S: Freeze,

§

impl<T, S> RefUnwindSafe for SimdFor<T, S>

§

impl<T, S> Send for SimdFor<T, S>
where S: Send, T: Send,

§

impl<T, S> Sync for SimdFor<T, S>
where S: Sync, T: Sync,

§

impl<T, S> Unpin for SimdFor<T, S>
where S: Unpin, T: Unpin,

§

impl<T, S> UnwindSafe for SimdFor<T, S>
where S: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T, U> Imply<T> for U