Skip to content
Open
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
18 changes: 11 additions & 7 deletions include/svs/orchestrators/vamana.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ class VamanaInterface {

virtual size_t get_graph_max_degree() const = 0;

///// Memory accounting
virtual svs::index::vamana::MemoryBreakdown get_memory_breakdown() const = 0;

virtual void set_construction_window_size(size_t window_size) = 0;
virtual size_t get_construction_window_size() const = 0;

Expand Down Expand Up @@ -104,6 +101,12 @@ class VamanaInterface {

// Non-templated virtual method for distance calculation
virtual double get_distance(size_t id, const AnonymousArray<1>& query) const = 0;

///// Memory accounting
// New virtuals belong at the end of the interface: inserting one shifts every
// later vtable slot, and a consumer built against the old header then dispatches
// through the wrong slot with no link-time diagnostic.
virtual svs::index::vamana::MemoryBreakdown get_memory_breakdown() const = 0;
};

template <lib::TypeList QueryTypes, typename Impl, typename IFace = VamanaInterface>
Expand All @@ -130,10 +133,6 @@ class VamanaImpl : public manager::ManagerImpl<QueryTypes, Impl, IFace> {

size_t get_graph_max_degree() const override { return impl().get_graph_max_degree(); }

svs::index::vamana::MemoryBreakdown get_memory_breakdown() const override {
return impl().get_memory_breakdown();
}

void set_construction_window_size(size_t window_size) override {
impl().set_construction_window_size(window_size);
}
Expand Down Expand Up @@ -274,6 +273,11 @@ class VamanaImpl : public manager::ManagerImpl<QueryTypes, Impl, IFace> {
}
);
}

///// Memory accounting
svs::index::vamana::MemoryBreakdown get_memory_breakdown() const override {
return impl().get_memory_breakdown();
}
};

///// Forward declarations
Expand Down
Loading