Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/VecSim/index_factories/tiered_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
14 changes: 14 additions & 0 deletions src/VecSim/vec_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cassert>
#include "memory.h"

Expand All @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down