File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818#include < faiss/gpu/utils/Float16.cuh>
1919#include < limits>
2020
21- #if defined USE_NVIDIA_CUVS
21+ #if defined( USE_NVIDIA_CUVS) && !defined(FAISS_CUVS_NO_FLAT)
2222#include < faiss/gpu/impl/CuvsFlatIndex.cuh>
2323#endif
2424
@@ -93,7 +93,7 @@ GpuIndexFlat::GpuIndexFlat(
9393GpuIndexFlat::~GpuIndexFlat () {}
9494
9595void GpuIndexFlat::resetIndex_ (int dims) {
96- #if defined USE_NVIDIA_CUVS
96+ #if defined( USE_NVIDIA_CUVS) && !defined(FAISS_CUVS_NO_FLAT)
9797
9898 if (should_use_cuvs (config_)) {
9999 data_.reset (new CuvsFlatIndex (
@@ -102,12 +102,17 @@ void GpuIndexFlat::resetIndex_(int dims) {
102102 flatConfig_.useFloat16 ,
103103 config_.memorySpace ));
104104 } else
105- #else
105+ #elif !defined(USE_NVIDIA_CUVS)
106106 if (should_use_cuvs (config_)) {
107107 FAISS_THROW_MSG (
108108 " cuVS has not been compiled into the current version so it cannot be used." );
109109 } else
110110#endif
111+ // When cuVS is compiled in but the cuVS flat backend is pruned
112+ // (FAISS_CUVS_NO_FLAT — e.g. the cuVS 26.02 IVF-PQ-only build on aarch64,
113+ // whose cuvs-ivfpq-2602 dep omits neighbors/brute_force), should_use_cuvs
114+ // may still be true; fall back to the classic GPU FlatIndex
115+ // (bfKnnOnDevice), which is functionally equivalent for brute-force search.
111116 {
112117 data_.reset (new FlatIndex (
113118 resources_.get (),
You can’t perform that action at this time.
0 commit comments