Skip to main content

Crate quiver_simd

Crate quiver_simd 

Source
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-length f32 vectors.
dot_f32
Inner product (dot product) of two equal-length f32 vectors.
dot_i8
Inner product of two equal-length i8 vectors, accumulated in i32.
hamming_u64
Hamming distance of two equal-length packed-bit vectors: the number of differing bits, popcount(a XOR b), over u64 words.
l2_sq_f32
Squared Euclidean distance of two equal-length f32 vectors.
l2_sq_i8
Squared Euclidean distance of two equal-length i8 vectors, in i32.