Skip to content
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ option(FAISS_ENABLE_PYTHON "Build Python extension." ON)
option(FAISS_ENABLE_C_API "Build C API." OFF)
option(FAISS_ENABLE_EXTRAS "Build extras like benchmarks and demos" ON)
option(FAISS_USE_LTO "Enable Link-Time optimization" OFF)
option(FAISS_ENABLE_AVX512_FP16 "Enable AVX512-FP16 arithmetic (for avx512_spr opt level)." OFF)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a runtime option not a compile-time option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mdouze. The current functions, like reconstruct_8_components and reconstruct_16_components, are picked at compile time. I'm not exactly sure how to approach what you're suggesting. Could you explain a bit more?


if(FAISS_ENABLE_GPU)
if(FAISS_ENABLE_ROCM)
Expand Down
8 changes: 8 additions & 0 deletions faiss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,14 @@ target_compile_definitions(faiss_avx512 PRIVATE FINTEGER=int)
target_compile_definitions(faiss_avx512_spr PRIVATE FINTEGER=int)
target_compile_definitions(faiss_sve PRIVATE FINTEGER=int)

if(FAISS_ENABLE_AVX512_FP16)
if (FAISS_OPT_LEVEL STREQUAL "avx512_spr")
target_compile_definitions(faiss_avx512_spr PRIVATE ENABLE_AVX512_FP16)
else()
message(STATUS "AVX512_FP16 not supported: requires FAISS_OPT_LEVEL=avx512_spr.")
endif()
endif()

if(FAISS_USE_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_error)
Expand Down
Loading
Loading