Skip to main content

simd_binop

Function simd_binop 

Source
pub fn simd_binop(a: &[f64], b: &[f64], op: BinOp) -> Vec<f64>
Expand description

SIMD-accelerated element-wise binary operation on equal-length slices.

Returns a new Vec with out[i] = a[i] ⊕ b[i] for the chosen operation. Bit-identical to the scalar loop a.iter().zip(b).map(|(&x, &y)| op(x, y)).

For tensors > 100K elements (when the parallel feature is enabled), splits work across threads with each thread using SIMD on its chunk. Deterministic because each element is independent (no cross-element reduction).