Expand description
SIMD-optimized distance computation
This module provides platform-specific SIMD implementations for common distance metrics used in vector search. Supports:
- ARM NEON (aarch64)
- x86 SSE/AVX/AVX2/AVX-512
- Scalar fallback for other platforms
Distance metrics:
- L2 (Euclidean) distance
- Cosine similarity/distance
- Dot product
The implementations use runtime feature detection to select the best available instruction set for the current CPU.
Functionsยง
- cosine_
distance - Compute cosine distance (1 - cosine similarity) using SIMD
- dot_
product - Compute dot product between two vectors using SIMD
- l2_
distance - Compute L2 (Euclidean) distance between two vectors using SIMD