From 2e9f80824bdaa7be1953d38587ee8a03e34d2b52 Mon Sep 17 00:00:00 2001 From: Blaise Muhirwa Date: Wed, 6 Dec 2023 07:40:14 -0800 Subject: [PATCH] default to avx in inner product (#18) Co-authored-by: blaise-muhirwa --- flatnav/distances/InnerProductDistance.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flatnav/distances/InnerProductDistance.h b/flatnav/distances/InnerProductDistance.h index 9b337ca..1f7cd68 100644 --- a/flatnav/distances/InnerProductDistance.h +++ b/flatnav/distances/InnerProductDistance.h @@ -92,7 +92,11 @@ class InnerProductDistance : public DistanceInterface { #endif if (!(_dimension % 16 == 0)) { if (_dimension % 4 == 0) { +#if defined(USE_AVX) + _distance_computer = distanceImplInnerProductSIMD4ExtAVX; +#else _distance_computer = distanceImplInnerProductSIMD4ExtSSE; +#endif } else if (_dimension > 16) { _distance_computer = distanceImplInnerProductSIMD16ExtResiduals; } else if (_dimension > 4) {