Skip to content

Commit 64be844

Browse files
Adds a more sensible check for FAISS use in benchmarks. CUVS_ANN_BENCH_USE_FAISS is now set to OFF if all relevant flags are set OFF.
The status is reported in the cmake log: -- Finding or building hnswlib -- Checking for FAISS use in benchmarks... -- CUVS_ANN_BENCH_USE_FAISS is OFF Closes #1590.
1 parent 2cf5fa7 commit 64be844

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

cpp/bench/ann/CMakeLists.txt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,31 @@ option(CUVS_KNN_BENCH_USE_CUVS_BRUTE_FORCE "Include cuVS brute force knn in benc
5151

5252
find_package(Threads REQUIRED)
5353

54-
set(CUVS_ANN_BENCH_USE_FAISS ON)
54+
# ----- FAISS use in Benchmarks ----
55+
get_cmake_property(_variableNames VARIABLES)
56+
57+
set(CUVS_ANN_BENCH_USE_FAISS OFF)
58+
message(STATUS "Checking for FAISS use in benchmarks...")
59+
foreach(_varName ${_variableNames})
60+
if(_varName MATCHES "CUVS_ANN_BENCH_USE_FAISS.+")
61+
if(DEFINED ${_varName})
62+
if(${_varName})
63+
set(CUVS_ANN_BENCH_USE_FAISS ON)
64+
message(STATUS "FAISS use in benchmarks detected.")
65+
break()
66+
endif()
67+
endif()
68+
endif()
69+
endforeach()
70+
71+
if(CUVS_ANN_BENCH_USE_FAISS)
72+
message(STATUS "CUVS_ANN_BENCH_USE_FAISS is ON")
73+
else()
74+
message(STATUS "CUVS_ANN_BENCH_USE_FAISS is OFF")
75+
endif()
76+
77+
# ----------------------------------
78+
5579
set(CUVS_FAISS_ENABLE_GPU ON)
5680
set(CUVS_USE_FAISS_STATIC ON)
5781

0 commit comments

Comments
 (0)