diff --git a/src/VecSim/index_factories/tiered_factory.h b/src/VecSim/index_factories/tiered_factory.h index fbb55d3b3..3cf0d5db5 100644 --- a/src/VecSim/index_factories/tiered_factory.h +++ b/src/VecSim/index_factories/tiered_factory.h @@ -13,7 +13,9 @@ #include "VecSim/memory/vecsim_malloc.h" #include "VecSim/vec_sim_index.h" #include "VecSim/algorithms/hnsw/hnsw_tiered.h" +#if HAVE_SVS #include "VecSim/algorithms/svs/svs_tiered.h" +#endif #include "VecSim/algorithms/brute_force/brute_force.h" #include "VecSim/index_factories/factory_utils.h" diff --git a/src/VecSim/vec_sim.cpp b/src/VecSim/vec_sim.cpp index 4fed53ab8..9da4eb392 100644 --- a/src/VecSim/vec_sim.cpp +++ b/src/VecSim/vec_sim.cpp @@ -15,7 +15,9 @@ #include "VecSim/vec_sim_index.h" #include "VecSim/vec_sim_adhoc_bf_ctx.h" #include "VecSim/types/bfloat16.h" +#if HAVE_SVS #include "VecSim/algorithms/svs/svs_utils.h" +#endif #include #include "memory.h" @@ -41,10 +43,16 @@ extern "C" void VecSim_UpdateThreadPoolSize(size_t new_size) { } else { VecSimIndex::setWriteMode(VecSim_WriteAsync); } +#if HAVE_SVS // Resize the shared SVS pool. Clamped to a minimum of 1. OS threads are spawned // lazily on first SVS index creation; once an index exists this resizes the // shared pool immediately (cooperating with the deferred-shrink protocol). VecSimSVSThreadPool::resize(new_size); +#else + // No SVS, so there is no shared pool to resize; the write mode set above is + // all this call has to do. + (void)new_size; +#endif } static VecSimResolveCode _ResolveParams_EFRuntime(VecSimAlgo index_type, VecSimRawParam rparam, @@ -392,7 +400,13 @@ extern "C" VecSimDebugInfoIterator *VecSimIndex_DebugInfoIterator(VecSimIndex *i } extern "C" size_t VecSim_GetSharedMemory(void) { +#if HAVE_SVS return VecSimSVSThreadPool::getSharedAllocationSize(); +#else + // The shared pool is an SVS construct; without it no memory is held outside + // the individual indexes, which already report their own. + return 0; +#endif } extern "C" VecSimIndexBasicInfo VecSimIndex_BasicInfo(VecSimIndex *index) {