Struct SimdFor

Source
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>

Source

pub fn new(simd: S) -> Self

Create a new wrapper from a simd token.

Source

pub fn align_offset(self, slice: SliceGroup<'_, E>) -> Offset<E::SimdMask<S>>

Computes the alignment offset for subsequent aligned loads.

Source

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.

Source

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.

Source

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.

Source

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).

Source

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).

Source

pub fn splat(self, value: E) -> SimdGroupFor<E, S>

Fill all the register lanes with the same value.

Source

pub fn scalar_mul(self, lhs: E, rhs: E) -> E

Returns lhs * rhs.

Source

pub fn scalar_conj_mul(self, lhs: E, rhs: E) -> E

Returns conj(lhs) * rhs.

Source

pub fn scalar_mul_add_e(self, lhs: E, rhs: E, acc: E) -> E

Returns an estimate of lhs * rhs + acc.

Source

pub fn scalar_conj_mul_add_e(self, lhs: E, rhs: E, acc: E) -> E

Returns an estimate of conj(lhs) * rhs + acc.

Source

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.

Source

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.

Source

pub fn add( self, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>

Returns lhs + rhs.

Source

pub fn sub( self, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>

Returns lhs - rhs.

Source

pub fn neg(self, a: SimdGroupFor<E, S>) -> SimdGroupFor<E, S>

Returns -a.

Source

pub fn scale_real( self, lhs: SimdGroupFor<E::Real, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>

Returns lhs * rhs.

Source

pub fn mul( self, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>

Returns lhs * rhs.

Source

pub fn conj_mul( self, lhs: SimdGroupFor<E, S>, rhs: SimdGroupFor<E, S>, ) -> SimdGroupFor<E, S>

Returns conj(lhs) * rhs.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn abs2(self, values: SimdGroupFor<E, S>) -> SimdGroupFor<E::Real, S>

Returns abs(values) * abs(values).

Source

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.

Source

pub fn reduce_add(self, values: SimdGroupFor<E, S>) -> E

Sum the components of a vector register into a single accumulator.

Source

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>

Source

pub fn abs(self, values: SimdGroupFor<E, S>) -> SimdGroupFor<E::Real, S>

Returns abs(values).

Source

pub fn less_than( self, a: SimdGroupFor<E, S>, b: SimdGroupFor<E, S>, ) -> SimdMaskFor<E, S>

Returns a < b.

Source

pub fn less_than_or_equal( self, a: SimdGroupFor<E, S>, b: SimdGroupFor<E, S>, ) -> SimdMaskFor<E, S>

Returns a <= b.

Source

pub fn greater_than( self, a: SimdGroupFor<E, S>, b: SimdGroupFor<E, S>, ) -> SimdMaskFor<E, S>

Returns a > b.

Source

pub fn greater_than_or_equal( self, a: SimdGroupFor<E, S>, b: SimdGroupFor<E, S>, ) -> SimdMaskFor<E, S>

Returns a >= b.

Source

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 }

Source

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 }

Source

pub fn index_seq(self) -> SimdIndexFor<E, S>

Returns [0, 1, 2, 3, ..., REGISTER_SIZE - 1]

Source

pub fn index_splat(self, value: IndexFor<E>) -> SimdIndexFor<E, S>

Fill all the register lanes with the same value.

Source

pub fn index_add( self, a: SimdIndexFor<E, S>, b: SimdIndexFor<E, S>, ) -> SimdIndexFor<E, S>

Returns a + b.

Trait Implementations§

Source§

impl<E: Entity, S: Simd> Clone for SimdFor<E, S>

Source§

fn clone(&self) -> Self

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<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>

§

impl<E, S> Send for SimdFor<E, S>

§

impl<E, S> Sync for SimdFor<E, S>

§

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

§

impl<E, S> UnwindSafe for SimdFor<E, S>
where S: UnwindSafe, E: 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.