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: SArchitecture specific Simd information.
Implementations§
Source§impl<T: RlstSimd, S: Simd> SimdFor<T, S>
impl<T: RlstSimd, S: Simd> SimdFor<T, S>
Sourcepub fn simd_vector_width(self) -> usize
pub fn simd_vector_width(self) -> usize
Length of a Simd vector.
Sourcepub fn cmp_eq(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Mask<S>
pub fn cmp_eq(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Mask<S>
Compare for equality.
Sourcepub fn cmp_lt(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Mask<S>
pub fn cmp_lt(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Mask<S>
Compare for less than.
Sourcepub fn cmp_le(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Mask<S>
pub fn cmp_le(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Mask<S>
Compare for less equal.
Sourcepub fn select(
self,
mask: T::Mask<S>,
if_true: T::Scalars<S>,
if_false: T::Scalars<S>,
) -> T::Scalars<S>
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.
Sourcepub fn add(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>
pub fn add(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>
Add two Simd vectors.
Sourcepub fn sub(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>
pub fn sub(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>
Subtract two Simd vectors.
Sourcepub fn mul(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>
pub fn mul(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>
Multiply two Simd vectors.
Sourcepub fn mul_add(
self,
lhs: T::Scalars<S>,
rhs: T::Scalars<S>,
acc: T::Scalars<S>,
) -> T::Scalars<S>
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.
Sourcepub fn div(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>
pub fn div(self, lhs: T::Scalars<S>, rhs: T::Scalars<S>) -> T::Scalars<S>
Divide two Simd vectors.
Sourcepub fn sin_cos(self, value: T::Scalars<S>) -> (T::Scalars<S>, T::Scalars<S>)
pub fn sin_cos(self, value: T::Scalars<S>) -> (T::Scalars<S>, T::Scalars<S>)
Compute the sine and cosine of two Simd vectors.
Sourcepub fn exp(self, value: T::Scalars<S>) -> T::Scalars<S>
pub fn exp(self, value: T::Scalars<S>) -> T::Scalars<S>
Compute the base e exponential of a Simd vector.
Sourcepub fn sqrt(self, value: T::Scalars<S>) -> T::Scalars<S>
pub fn sqrt(self, value: T::Scalars<S>) -> T::Scalars<S>
Compute the square root of a Simd vector.
Sourcepub fn approx_recip(self, value: T::Scalars<S>) -> T::Scalars<S>
pub fn approx_recip(self, value: T::Scalars<S>) -> T::Scalars<S>
Compute an approximate inverse of a Simd vector.
Sourcepub fn approx_recip_sqrt(self, value: T::Scalars<S>) -> T::Scalars<S>
pub fn approx_recip_sqrt(self, value: T::Scalars<S>) -> T::Scalars<S>
Compute an approximate inverse of a Simd vector.
Sourcepub fn reduce_add(self, value: T::Scalars<S>) -> T
pub fn reduce_add(self, value: T::Scalars<S>) -> T
Sum the elements of a Simd vector.
Trait Implementations§
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>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, S> Send for SimdFor<T, S>
impl<T, S> Sync for SimdFor<T, S>
impl<T, S> Unpin for SimdFor<T, S>
impl<T, S> UnwindSafe for SimdFor<T, S>where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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