SimdOps

Struct SimdOps 

Source
pub struct SimdOps { /* private fields */ }
Expand description

SIMD-optimized operations for pipeline processing

Implementations§

Source§

impl SimdOps

Source

pub fn new(config: SimdConfig) -> Self

Create new SIMD operations instance

Source

pub fn default() -> Self

Create with default configuration

Source

pub fn add_arrays( &self, a: &ArrayView1<'_, Float>, b: &ArrayView1<'_, Float>, ) -> SklResult<Array1<Float>>

Vectorized addition of two arrays

Source

pub fn matrix_multiply( &self, a: &ArrayView2<'_, Float>, b: &ArrayView2<'_, Float>, ) -> SklResult<Array2<Float>>

Vectorized matrix multiplication

Source

pub fn dot_product( &self, a: &ArrayView1<'_, Float>, b: &ArrayView1<'_, Float>, ) -> SklResult<Float>

Vectorized dot product

Source

pub fn elementwise_op<F>( &self, a: &ArrayView1<'_, Float>, op: F, ) -> SklResult<Array1<Float>>
where F: Fn(Float) -> Float + Copy,

Vectorized element-wise operations

Source

pub fn normalize_l2( &self, a: &ArrayView1<'_, Float>, ) -> SklResult<Array1<Float>>

Vectorized normalization (L2 norm)

Source

pub fn scale( &self, a: &ArrayView1<'_, Float>, scale_factor: Float, ) -> SklResult<Array1<Float>>

Vectorized scaling

Source

pub fn aligned_array_1d(&self, size: usize) -> Array1<Float>

Memory-aligned array allocation for optimal SIMD performance

Source

pub fn aligned_array_2d(&self, rows: usize, cols: usize) -> Array2<Float>

Memory-aligned matrix allocation

Source

pub fn is_aligned(&self, ptr: *const Float) -> bool

Check if arrays are properly aligned for SIMD operations

Source

pub fn optimal_chunk_size(&self, total_size: usize) -> usize

Get optimal chunk size for parallel SIMD operations

Source

pub fn standardize_features( &self, data: &ArrayView2<'_, Float>, ) -> SklResult<Array2<Float>>

Vectorized feature standardization (z-score normalization)

Source

pub fn min_max_scale( &self, data: &ArrayView2<'_, Float>, ) -> SklResult<Array2<Float>>

Vectorized min-max scaling

Source

pub fn polynomial_features( &self, data: &ArrayView2<'_, Float>, degree: usize, ) -> SklResult<Array2<Float>>

Generate polynomial features up to specified degree

Source

pub fn vectorized_sum(&self, data: &ArrayView1<'_, Float>) -> SklResult<Float>

Vectorized sum with SIMD optimization

Source

pub unsafe fn cache_oblivious_transpose( &self, src: *const Float, dst: *mut Float, src_rows: usize, src_cols: usize, dst_cols: usize, row_start: usize, col_start: usize, block_rows: usize, block_cols: usize, ) -> SklResult<()>

Unsafe cache-oblivious matrix transpose for better cache performance

§Safety

This function is unsafe because:

  • It performs unchecked pointer arithmetic
  • It assumes valid memory layouts for source and destination
  • It uses recursive divide-and-conquer with raw pointers

Auto Trait Implementations§

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> 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, 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V