Skip to content

Commit

Permalink
Additional commits to make AVX2 work with MSVC
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
borrrden committed Feb 13, 2024
1 parent 9dfcd39 commit 93cf1be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions faiss/impl/platform_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 93cf1be

Please sign in to comment.