Skip to content

Commit

Permalink
Cherry-pick commit #3416 from Faiss baseline (zilliztech#562)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Guzhva <[email protected]>
  • Loading branch information
alexanderguzhva authored May 17, 2024
1 parent e0c9c41 commit 89657b0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions thirdparty/faiss/faiss/impl/platform_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ inline int __builtin_clzll(uint64_t x) {
__pragma(float_control(precise, off, push))
#define FAISS_PRAGMA_IMPRECISE_FUNCTION_END __pragma(float_control(pop))
#elif defined(__clang__)
#if defined(__PPC__)
#define FAISS_PRAGMA_IMPRECISE_LOOP \
_Pragma("clang loop vectorize_width(4) interleave_count(8)")
#define FAISS_PRAGMA_IMPRECISE_FUNCTION_BEGIN \
_Pragma("float_control(precise, off, push)")
#define FAISS_PRAGMA_IMPRECISE_FUNCTION_END _Pragma("float_control(pop)")
#else
#define FAISS_PRAGMA_IMPRECISE_LOOP \
_Pragma("clang loop vectorize(enable) interleave(enable)")

Expand All @@ -144,6 +151,7 @@ inline int __builtin_clzll(uint64_t x) {
#define FAISS_PRAGMA_IMPRECISE_FUNCTION_BEGIN
#define FAISS_PRAGMA_IMPRECISE_FUNCTION_END
#endif
#endif
#elif defined(__GNUC__)
// Unfortunately, GCC does not provide a pragma for detecting it.
// So, we have to stick to GNUC, which is defined by MANY compilers.
Expand Down

0 comments on commit 89657b0

Please sign in to comment.