pub struct SimdFor<E: Entity, S: Simd> {
pub simd: S,
/* private fields */
}
Expand description
Wrapper for simd operations for type E
.
Fields§
§simd: S
Simd token.
Implementations§
Source§impl<E: ComplexField, S: Simd> SimdFor<E, S>
impl<E: ComplexField, S: Simd> SimdFor<E, S>
Sourcepub fn align_offset(self, slice: SliceGroup<'_, E>) -> Offset<E::SimdMask<S>>
pub fn align_offset(self, slice: SliceGroup<'_, E>) -> Offset<E::SimdMask<S>>
Computes the alignment offset for subsequent aligned loads.
Sourcepub fn align_offset_ptr(
self,
ptr: GroupFor<E, *const E::Unit>,
len: usize,
) -> Offset<E::SimdMask<S>>
pub fn align_offset_ptr( self, ptr: GroupFor<E, *const E::Unit>, len: usize, ) -> Offset<E::SimdMask<S>>
Computes the alignment offset for subsequent aligned loads from a pointer.
Sourcepub fn as_simd(
self,
slice: SliceGroup<'_, E>,
) -> (SliceGroup<'_, E, SimdUnitFor<E, S>>, SliceGroup<'_, E>)
pub fn as_simd( self, slice: SliceGroup<'_, E>, ) -> (SliceGroup<'_, E, SimdUnitFor<E, S>>, SliceGroup<'_, E>)
Convert a slice to a slice over vector registers, and a scalar tail.
Sourcepub fn as_simd_mut(
self,
slice: SliceGroupMut<'_, E>,
) -> (SliceGroupMut<'_, E, SimdUnitFor<E, S>>, SliceGroupMut<'_, E>)
pub fn as_simd_mut( self, slice: SliceGroupMut<'_, E>, ) -> (SliceGroupMut<'_, E, SimdUnitFor<E, S>>, SliceGroupMut<'_, E>)
Convert a mutable slice to a slice over vector registers, and a scalar tail.
Sourcepub fn as_aligned_simd(
self,
slice: SliceGroup<'_, E>,
offset: Offset<E::SimdMask<S>>,
) -> (Prefix<'_, E, S>, SliceGroup<'_, E, SimdUnitFor<E, S>>, Suffix<'_, E, S>)
pub fn as_aligned_simd( self, slice: SliceGroup<'_, E>, offset: Offset<E::SimdMask<S>>, ) -> (Prefix<'_, E, S>, SliceGroup<'_, E, SimdUnitFor<E, S>>, Suffix<'_, E, S>)
Convert a slice to a partial register prefix and suffix, and a vector register slice (body).
Sourcepub fn as_aligned_simd_mut(
self,
slice: SliceGroupMut<'_, E>,
offset: Offset<E::SimdMask<S>>,
) -> (PrefixMut<'_, E, S>, SliceGroupMut<'_, E, SimdUnitFor<E, S>>, SuffixMut<'_, E, S>)
pub fn as_aligned_simd_mut( self, slice: SliceGroupMut<'_, E>, offset: Offset<E::SimdMask<S>>, ) -> (PrefixMut<'_, E, S>, SliceGroupMut<'_, E, SimdUnitFor<E, S>>, SuffixMut<'_, E, S>)
Convert a mutable slice to a partial register prefix and suffix, and a vector register slice (body).
Sourcepub fn splat(self, value: E) -> SimdGroupFor<E, S>
pub fn splat(self, value: E) -> SimdGroupFor<E, S>
Fill all the register lanes with the same value.
Sourcepub fn scalar_mul(self, lhs: E, rhs: E) -> E
pub fn scalar_mul(self, lhs: E, rhs: E) -> E
Returns lhs * rhs
.
Sourcepub fn scalar_conj_mul(self, lhs: E, rhs: E) -> E
pub fn scalar_conj_mul(self, lhs: E, rhs: E) -> E
Returns conj(lhs) * rhs
.
Sourcepub fn scalar_mul_add_e(self, lhs: E, rhs: E, acc: E) -> E
pub fn scalar_mul_add_e(self, lhs: E, rhs: E, acc: E) -> E
Returns an estimate of lhs * rhs + acc
.
Sourcepub fn scalar_conj_mul_add_e(self, lhs: E, rhs: E, acc: E) -> E
pub fn scalar_conj_mul_add_e(self, lhs: E, rhs: E, acc: E) -> E
Returns an estimate of conj(lhs) * rhs + acc
.
Sourcepub fn scalar_conditional_conj_mul<C: ConjTy>(
self,
conj: C,
lhs: E,
rhs: E,
) -> E
pub fn scalar_conditional_conj_mul<C: ConjTy>( self, conj: C, lhs: E, rhs: E, ) -> E
Returns an estimate of op(lhs) * rhs
, where op
is either the conjugation
or the identity operation.
Sourcepub fn scalar_conditional_conj_mul_add_e<C: ConjTy>(
self,
conj: C,
lhs: E,
rhs: E,
acc: E,
) -> E
pub fn scalar_conditional_conj_mul_add_e<C: ConjTy>( self, conj: C, lhs: E, rhs: E, acc: E, ) -> E
Returns an estimate of op(lhs) * rhs + acc
, where op
is either the conjugation or
the identity operation.
Sourcepub fn add(
self,
lhs: SimdGroupFor<E, S>,
rhs: SimdGroupFor<E, S>,
) -> SimdGroupFor<E, S>
pub fn add( self, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>
Returns lhs + rhs
.
Sourcepub fn sub(
self,
lhs: SimdGroupFor<E, S>,
rhs: SimdGroupFor<E, S>,
) -> SimdGroupFor<E, S>
pub fn sub( self, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>
Returns lhs - rhs
.
Sourcepub fn neg(self, a: SimdGroupFor<E, S>) -> SimdGroupFor<E, S>
pub fn neg(self, a: SimdGroupFor<E, S>) -> SimdGroupFor<E, S>
Returns -a
.
Sourcepub fn scale_real(
self,
lhs: SimdGroupFor<E::Real, S>,
rhs: SimdGroupFor<E, S>,
) -> SimdGroupFor<E, S>
pub fn scale_real( self, lhs: SimdGroupFor<E::Real, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>
Returns lhs * rhs
.
Sourcepub fn mul(
self,
lhs: SimdGroupFor<E, S>,
rhs: SimdGroupFor<E, S>,
) -> SimdGroupFor<E, S>
pub fn mul( self, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>
Returns lhs * rhs
.
Sourcepub fn conj_mul(
self,
lhs: SimdGroupFor<E, S>,
rhs: SimdGroupFor<E, S>,
) -> SimdGroupFor<E, S>
pub fn conj_mul( self, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>
Returns conj(lhs) * rhs
.
Sourcepub fn conditional_conj_mul<C: ConjTy>(
self,
conj: C,
lhs: SimdGroupFor<E, S>,
rhs: SimdGroupFor<E, S>,
) -> SimdGroupFor<E, S>
pub fn conditional_conj_mul<C: ConjTy>( self, conj: C, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>
Returns op(lhs) * rhs
, where op
is either the conjugation or the identity
operation.
Sourcepub fn mul_add_e(
self,
lhs: SimdGroupFor<E, S>,
rhs: SimdGroupFor<E, S>,
acc: SimdGroupFor<E, S>,
) -> SimdGroupFor<E, S>
pub fn mul_add_e( self, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, acc: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>
Returns lhs * rhs + acc
.
Sourcepub fn conj_mul_add_e(
self,
lhs: SimdGroupFor<E, S>,
rhs: SimdGroupFor<E, S>,
acc: SimdGroupFor<E, S>,
) -> SimdGroupFor<E, S>
pub fn conj_mul_add_e( self, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, acc: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>
Returns conj(lhs) * rhs + acc
.
Sourcepub fn conditional_conj_mul_add_e<C: ConjTy>(
self,
conj: C,
lhs: SimdGroupFor<E, S>,
rhs: SimdGroupFor<E, S>,
acc: SimdGroupFor<E, S>,
) -> SimdGroupFor<E, S>
pub fn conditional_conj_mul_add_e<C: ConjTy>( self, conj: C, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, acc: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>
Returns op(lhs) * rhs + acc
, where op
is either the conjugation or the identity
operation.
Sourcepub fn abs2_add_e(
self,
values: SimdGroupFor<E, S>,
acc: SimdGroupFor<E::Real, S>,
) -> SimdGroupFor<E::Real, S>
pub fn abs2_add_e( self, values: SimdGroupFor<E, S>, acc: SimdGroupFor<E::Real, S>, ) -> SimdGroupFor<E::Real, S>
Returns abs(values) * abs(values) + acc
.
Sourcepub fn abs2(self, values: SimdGroupFor<E, S>) -> SimdGroupFor<E::Real, S>
pub fn abs2(self, values: SimdGroupFor<E, S>) -> SimdGroupFor<E::Real, S>
Returns abs(values) * abs(values)
.
Sourcepub fn score(self, values: SimdGroupFor<E, S>) -> SimdGroupFor<E::Real, S>
pub fn score(self, values: SimdGroupFor<E, S>) -> SimdGroupFor<E::Real, S>
Returns abs(values)
or abs(values) * abs(values)
, whichever is cheaper to compute.
Sourcepub fn reduce_add(self, values: SimdGroupFor<E, S>) -> E
pub fn reduce_add(self, values: SimdGroupFor<E, S>) -> E
Sum the components of a vector register into a single accumulator.
Sourcepub fn rotate_left(
self,
values: SimdGroupFor<E, S>,
amount: usize,
) -> SimdGroupFor<E, S>
pub fn rotate_left( self, values: SimdGroupFor<E, S>, amount: usize, ) -> SimdGroupFor<E, S>
Rotate values
to the left, with overflowing entries wrapping around to the right side
of the register.
Source§impl<E: RealField, S: Simd> SimdFor<E, S>
impl<E: RealField, S: Simd> SimdFor<E, S>
Sourcepub fn abs(self, values: SimdGroupFor<E, S>) -> SimdGroupFor<E::Real, S>
pub fn abs(self, values: SimdGroupFor<E, S>) -> SimdGroupFor<E::Real, S>
Returns abs(values)
.
Sourcepub fn less_than(
self,
a: SimdGroupFor<E, S>,
b: SimdGroupFor<E, S>,
) -> SimdMaskFor<E, S>
pub fn less_than( self, a: SimdGroupFor<E, S>, b: SimdGroupFor<E, S>, ) -> SimdMaskFor<E, S>
Returns a < b
.
Sourcepub fn less_than_or_equal(
self,
a: SimdGroupFor<E, S>,
b: SimdGroupFor<E, S>,
) -> SimdMaskFor<E, S>
pub fn less_than_or_equal( self, a: SimdGroupFor<E, S>, b: SimdGroupFor<E, S>, ) -> SimdMaskFor<E, S>
Returns a <= b
.
Sourcepub fn greater_than(
self,
a: SimdGroupFor<E, S>,
b: SimdGroupFor<E, S>,
) -> SimdMaskFor<E, S>
pub fn greater_than( self, a: SimdGroupFor<E, S>, b: SimdGroupFor<E, S>, ) -> SimdMaskFor<E, S>
Returns a > b
.
Sourcepub fn greater_than_or_equal(
self,
a: SimdGroupFor<E, S>,
b: SimdGroupFor<E, S>,
) -> SimdMaskFor<E, S>
pub fn greater_than_or_equal( self, a: SimdGroupFor<E, S>, b: SimdGroupFor<E, S>, ) -> SimdMaskFor<E, S>
Returns a >= b
.
Sourcepub fn select(
self,
mask: SimdMaskFor<E, S>,
if_true: SimdGroupFor<E, S>,
if_false: SimdGroupFor<E, S>,
) -> SimdGroupFor<E, S>
pub fn select( self, mask: SimdMaskFor<E, S>, if_true: SimdGroupFor<E, S>, if_false: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>
Returns if mask { if_true } else { if_false }
Sourcepub fn index_select(
self,
mask: SimdMaskFor<E, S>,
if_true: SimdIndexFor<E, S>,
if_false: SimdIndexFor<E, S>,
) -> SimdIndexFor<E, S>
pub fn index_select( self, mask: SimdMaskFor<E, S>, if_true: SimdIndexFor<E, S>, if_false: SimdIndexFor<E, S>, ) -> SimdIndexFor<E, S>
Returns if mask { if_true } else { if_false }
Sourcepub fn index_seq(self) -> SimdIndexFor<E, S>
pub fn index_seq(self) -> SimdIndexFor<E, S>
Returns [0, 1, 2, 3, ..., REGISTER_SIZE - 1]
Sourcepub fn index_splat(self, value: IndexFor<E>) -> SimdIndexFor<E, S>
pub fn index_splat(self, value: IndexFor<E>) -> SimdIndexFor<E, S>
Fill all the register lanes with the same value.
Sourcepub fn index_add(
self,
a: SimdIndexFor<E, S>,
b: SimdIndexFor<E, S>,
) -> SimdIndexFor<E, S>
pub fn index_add( self, a: SimdIndexFor<E, S>, b: SimdIndexFor<E, S>, ) -> SimdIndexFor<E, S>
Returns a + b
.
Trait Implementations§
impl<E: Entity, S: Simd> Copy for SimdFor<E, S>
Auto Trait Implementations§
impl<E, S> Freeze for SimdFor<E, S>where
S: Freeze,
impl<E, S> RefUnwindSafe for SimdFor<E, S>where
S: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, S> Send for SimdFor<E, S>
impl<E, S> Sync for SimdFor<E, S>
impl<E, S> Unpin for SimdFor<E, S>
impl<E, S> UnwindSafe for SimdFor<E, S>where
S: UnwindSafe,
E: 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
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>
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>
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