From 93cf1bea3a58d5102445243ae79d2060471e7a41 Mon Sep 17 00:00:00 2001 From: Jim Borden Date: Sat, 3 Feb 2024 07:30:40 +0900 Subject: [PATCH] Additional commits to make AVX2 work with MSVC Note that this requires the /openmp:llvm option to be enabled. The `_OPENMP` define is the same between /openmp and /openmp:llvm meaning there is no way to tell whether or not unsigned index types in OpenMP loops are usable, and thus cannot be switched between at compile time. --- faiss/impl/platform_macros.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/faiss/impl/platform_macros.h b/faiss/impl/platform_macros.h index daefb26427..2aecc51222 100644 --- a/faiss/impl/platform_macros.h +++ b/faiss/impl/platform_macros.h @@ -66,6 +66,11 @@ inline int __builtin_clzll(uint64_t x) { #define __builtin_popcount __popcnt #define __builtin_popcountl __popcnt64 +#ifndef __clang__ +#define __m128i_u __m128i +#define __m256i_u __m256i +#endif + // MSVC does not define __SSEx__, and _M_IX86_FP is only defined on 32-bit // processors cf. // https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros