Skip to content

Commit

Permalink
fix(simd): disable broken get_best_from_dists_f64_avx2 until fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sdd committed Dec 15, 2024
1 parent 231cf64 commit b7d71c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/float_leaf_slice/leaf_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use std::slice::ChunksExact;

const CHUNK_SIZE: usize = 32;

#[cfg(all(
/*#[cfg(all(
feature = "simd",
target_feature = "avx2",
any(target_arch = "x86", target_arch = "x86_64")
))]
use super::f64_avx2::get_best_from_dists_f64_avx2;
use super::f64_avx2::get_best_from_dists_f64_avx2;*/
//use super::{f32_avx2::get_best_from_dists_f32_avx2};

// #[cfg(all(
Expand Down Expand Up @@ -310,14 +310,14 @@ where
get_best_from_dists_f64_avx512(&acc, items, best_dist, best_item)
}
} else */
if is_x86_feature_detected!("avx2") {
/*if is_x86_feature_detected!("avx2") {
#[cfg(target_feature = "avx2")]
unsafe {
get_best_from_dists_f64_avx2(&acc, items, best_dist, best_item)
}
} else {
update_nearest_dist_autovec(&acc, items, best_dist, best_item)
}
} else {*/
update_nearest_dist_autovec(&acc, items, best_dist, best_item)
// }
}

#[cfg(any(
Expand Down
14 changes: 8 additions & 6 deletions src/float_leaf_slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ pub mod leaf_slice;
// ))]
// pub(crate) mod f32_avx2;

#[cfg(all(
feature = "simd",
target_feature = "avx2",
any(target_arch = "x86", target_arch = "x86_64")
))]
pub(crate) mod f64_avx2;
// TODO: fix f64 AVX2

// #[cfg(all(
// feature = "simd",
// target_feature = "avx2",
// any(target_arch = "x86", target_arch = "x86_64")
// ))]
// pub(crate) mod f64_avx2;

// TODO: fix f32 AVX512

Expand Down

0 comments on commit b7d71c1

Please sign in to comment.