pub trait SimdKernel: Send + Sync {
// Required methods
fn batch_add(&self, a: &[f64], b: &[f64], out: &mut [f64]);
fn batch_sub(&self, a: &[f64], b: &[f64], out: &mut [f64]);
fn batch_mul(&self, a: &[f64], b: &[f64], out: &mut [f64]);
fn batch_div(&self, a: &[f64], b: &[f64], out: &mut [f64]);
fn batch_fma(&self, a: &[f64], b: &[f64], c: &[f64], out: &mut [f64]);
fn batch_sqrt(&self, a: &[f64], out: &mut [f64]);
fn batch_neg(&self, a: &[f64], out: &mut [f64]);
fn batch_abs(&self, a: &[f64], out: &mut [f64]);
fn name(&self) -> &'static str;
}Expand description
Batch arithmetic operations, abstracted over SIMD width and ISA.
Implementations must be Send + Sync so the global singleton is safe
across thread boundaries. Each method operates element-wise over equal-
length slices; callers guarantee slice lengths match.
Required Methods§
Sourcefn batch_add(&self, a: &[f64], b: &[f64], out: &mut [f64])
fn batch_add(&self, a: &[f64], b: &[f64], out: &mut [f64])
Element-wise addition: out[i] = a[i] + b[i].
Sourcefn batch_sub(&self, a: &[f64], b: &[f64], out: &mut [f64])
fn batch_sub(&self, a: &[f64], b: &[f64], out: &mut [f64])
Element-wise subtraction: out[i] = a[i] - b[i].
Sourcefn batch_mul(&self, a: &[f64], b: &[f64], out: &mut [f64])
fn batch_mul(&self, a: &[f64], b: &[f64], out: &mut [f64])
Element-wise multiplication: out[i] = a[i] * b[i].
Sourcefn batch_div(&self, a: &[f64], b: &[f64], out: &mut [f64])
fn batch_div(&self, a: &[f64], b: &[f64], out: &mut [f64])
Element-wise division: out[i] = a[i] / b[i].
Sourcefn batch_fma(&self, a: &[f64], b: &[f64], c: &[f64], out: &mut [f64])
fn batch_fma(&self, a: &[f64], b: &[f64], c: &[f64], out: &mut [f64])
Fused multiply-add: out[i] = a[i] * b[i] + c[i].
Sourcefn batch_sqrt(&self, a: &[f64], out: &mut [f64])
fn batch_sqrt(&self, a: &[f64], out: &mut [f64])
Element-wise square root: out[i] = sqrt(a[i]).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl SimdKernel for Avx2Kernel
Available on x86-64 only.