Expand description
SIMD distance kernels for Quiver — cosine, squared-L2, and inner product over
f32 and i8, plus Hamming distance over packed-bit (u64) vectors, with
runtime CPU-feature dispatch and a scalar fallback.
Each public function selects the best available implementation once per call
(is_x86_feature_detected! results are cached by std) and always has a
correct scalar fallback. The SIMD paths are differential-tested against the
scalar reference. Design: docs/index/distance-kernels.md, ADR-0009.
Enums§
- Metric
- A supported distance / similarity metric over dense vectors.
Functions§
- cosine_
f32 - Cosine similarity (in
[-1, 1]) of two equal-lengthf32vectors. - dot_f32
- Inner product (dot product) of two equal-length
f32vectors. - dot_i8
- Inner product of two equal-length
i8vectors, accumulated ini32. - hamming_
u64 - Hamming distance of two equal-length packed-bit vectors: the number of
differing bits,
popcount(a XOR b), overu64words. - l2_
sq_ f32 - Squared Euclidean distance of two equal-length
f32vectors. - l2_
sq_ i8 - Squared Euclidean distance of two equal-length
i8vectors, ini32.