This is an automated email from the ASF dual-hosted git repository.
airborne pushed a commit to branch faiss
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/faiss by this push:
new 0276f0bb7e4 [fix](faiss) only set mfma when avx is support because
noavx sse does not support fma (#366)
0276f0bb7e4 is described below
commit 0276f0bb7e4fc0694fe44f450f4f5cfbcb4dd5cc
Author: Jack <[email protected]>
AuthorDate: Mon Nov 3 18:19:43 2025 +0800
[fix](faiss) only set mfma when avx is support because noavx sse does not
support fma (#366)
---
CMakeLists.txt | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4f8b0aeba9..61a8050be4e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,9 +73,13 @@ option(FAISS_USE_LTO "Enable Link-Time optimization" OFF)
# Suppress warnings everywhere
add_compile_options(-Wno-everything)
+message(STATUS "FAISS_OPT_LEVEL=${FAISS_OPT_LEVEL}")
-# Only add -mfma on x86_64
-if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
+# Only add -mfma on x86_64 when avx is enable
+if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64"
+ AND (FAISS_OPT_LEVEL STREQUAL "avx2"
+ OR FAISS_OPT_LEVEL STREQUAL "avx512"
+ OR FAISS_OPT_LEVEL STREQUAL "avx512_spr"))
add_compile_options(-mfma)
endif()
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]