simd_operations

Macro simd_operations 

Source
macro_rules! simd_operations {
    ($(
        $op_name:ident: ($($param:ident: $param_type:ty),*) -> $return_type:ty {
            simd: |$($simd_param:ident),*| $simd_impl:expr,
            fallback: |$($fallback_param:ident),*| $fallback_impl:expr
        }
    ),* $(,)?) => { ... };
}
Expand description

Creates SIMD-optimized operation implementations

§Examples

simd_operations! {
    dot_product: (a: &[f64], b: &[f64]) -> f64 {
        simd: |a, b| simd_dot(a, b),
        fallback: |a, b| a.iter().zip(b).map(|(x, y)| x * y).sum()
    }
}