Skip to main content

Module vector_ops

Module vector_ops 

Source
Expand description

SIMD-accelerated vector operations for CPU fallback paths

Provides vectorized element-wise add, multiply, scale, dot product, and reduction operations. Architecture-specific implementations are selected at compile time via cfg(target_arch), with a scalar fallback for unsupported platforms.

Functionsยง

vector_add_f32
Element-wise addition: c[i] = a[i] + b[i]
vector_dot_f32
Dot product: sum(a[i] * b[i])
vector_mul_f32
Element-wise multiplication: c[i] = a[i] * b[i]
vector_reduce_sum_f32
Sum reduction: sum(a[i])
vector_scale_f32
Scale every element: c[i] = a[i] * scalar