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]> {
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_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§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.