diff --git a/src/svm/kernel/rbf.rs b/src/svm/kernel/rbf.rs index 9cf7428..844adc4 100644 --- a/src/svm/kernel/rbf.rs +++ b/src/svm/kernel/rbf.rs @@ -34,53 +34,9 @@ fn compute_core(rbf: Rbf, vectors: &MatSimd, feature: &VecSimd, feature: &VecSimd, output: &mut [f64]) { - compute_core(rbf, vectors, feature, output); -} - -#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] -#[target_feature(enable = "avx2")] -#[inline] -unsafe fn compute_avx2(rbf: Rbf, vectors: &MatSimd, feature: &VecSimd, output: &mut [f64]) { - compute_core(rbf, vectors, feature, output); -} - -#[cfg(target_arch = "aarch64")] -#[target_feature(enable = "neon")] -#[inline] -unsafe fn compute_neon(rbf: Rbf, vectors: &MatSimd, feature: &VecSimd, output: &mut [f64]) { - compute_core(rbf, vectors, feature, output); -} - -#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] #[inline] fn compute(rbf: Rbf, vectors: &MatSimd, feature: &VecSimd, output: &mut [f64]) { - if is_x86_feature_detected!("avx2") { - unsafe { compute_avx2(rbf, vectors, feature, output) } - } else if is_x86_feature_detected!("avx") { - unsafe { compute_avx(rbf, vectors, feature, output) } - } else { - compute_core(rbf, vectors, feature, output); - } -} - -#[cfg(target_arch = "aarch64")] -#[inline] -fn compute(rbf: Rbf, vectors: &MatSimd, feature: &VecSimd, output: &mut [f64]) { - if std::arch::is_aarch64_feature_detected!("neon") { - unsafe { compute_neon(rbf, vectors, feature, output) } - } else { - compute_core(rbf, vectors, feature, output) - } -} - -#[cfg(not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64")))] -#[inline] -fn compute(rbf: Rbf, vectors: &MatSimd, feature: &VecSimd, output: &mut [f64]) { - compute_core(rbf, vectors, feature, output) + compute_core(rbf, vectors, feature, output); } impl KernelDense for Rbf {