Trait lance_linalg::simd::SIMD
source · pub trait SIMD<T: Num + Copy, const N: usize>: Debug + AddAssign<Self> + Add<Self, Output = Self> + Mul<Self, Output = Self> + Sub<Self, Output = Self> + SubAssign<Self> + Copy + Clone + Sized + for<'a> From<&'a [T]> + for<'a> From<&'a [T; N]> {
const LANES: usize = N;
// Required methods
fn splat(val: T) -> Self;
fn zeros() -> Self;
unsafe fn load(ptr: *const T) -> Self;
unsafe fn load_unaligned(ptr: *const T) -> Self;
unsafe fn store(&self, ptr: *mut T);
unsafe fn store_unaligned(&self, ptr: *mut T);
fn reduce_sum(&self) -> T;
fn reduce_min(&self) -> T;
fn min(&self, rhs: &Self) -> Self;
fn find(&self, val: T) -> Option<i32>;
// Provided method
fn as_array(&self) -> [T; N] { ... }
}Expand description
Lance SIMD lib
Provided Associated Constants§
Required Methods§
sourceunsafe fn load(ptr: *const T) -> Self
unsafe fn load(ptr: *const T) -> Self
Gather elements from the slice, using i32 indices. Load aligned data from aligned memory.
Safety
It crashes if the ptr is not aligned.
sourceunsafe fn load_unaligned(ptr: *const T) -> Self
unsafe fn load_unaligned(ptr: *const T) -> Self
Load unaligned data from memory.
Safety
sourceunsafe fn store_unaligned(&self, ptr: *mut T)
unsafe fn store_unaligned(&self, ptr: *mut T)
Store the values to unaligned memory.
Safety
sourcefn reduce_sum(&self) -> T
fn reduce_sum(&self) -> T
Calculate the sum across this vector.
sourcefn reduce_min(&self) -> T
fn reduce_min(&self) -> T
Find the minimal value in the vector.
Provided Methods§
Object Safety§
This trait is not object safe.