nodedb_vector/distance/simd/mod.rs
1// SPDX-License-Identifier: Apache-2.0
2
3//! Runtime SIMD dispatch for vector distance and bitmap operations.
4
5pub mod bbq;
6pub mod hamming;
7pub mod runtime;
8pub mod scalar;
9
10// The x86 tier modules are crate-private on purpose. Their entry points are
11// safe `pub fn`s that call `#[target_feature]` implementations, so exposing the
12// module would let safe code outside the crate execute AVX2 or AVX-512
13// instructions on a host that does not have them. `SimdRuntime::detect()` is the
14// only supported way to reach a tier, and it selects one under a runtime feature
15// probe. NEON is baseline on aarch64 and wasm simd128 is a compile-time gate, so
16// those two stay public.
17#[cfg(target_arch = "x86_64")]
18pub(crate) mod avx2;
19#[cfg(target_arch = "x86_64")]
20pub(crate) mod avx512;
21#[cfg(target_arch = "aarch64")]
22pub mod neon;
23#[cfg(target_arch = "wasm32")]
24pub mod wasm_simd128;
25
26pub use runtime::{SimdRuntime, runtime};