Skip to content

Commit 534161d

Browse files
committed
Fix get_num_threads()
1 parent 2e15e09 commit 534161d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bindings/c/src/index.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct Index {
4848
virtual float get_distance(size_t id, std::span<const float> query) const = 0;
4949
virtual void
5050
reconstruct_at(svs::data::SimpleDataView<float> dst, std::span<const size_t> ids) = 0;
51-
virtual size_t get_num_threads() { return pool_builder.get_threads_num(); };
51+
virtual size_t get_num_threads() = 0;
5252
virtual void set_num_threads(size_t num_threads) = 0;
5353
};
5454

@@ -105,6 +105,8 @@ struct IndexVamana : public Index {
105105
index.reconstruct_at(dst, ids);
106106
}
107107

108+
size_t get_num_threads() override { return index.get_num_threads(); }
109+
108110
void set_num_threads(size_t num_threads) override {
109111
pool_builder.resize(num_threads);
110112
index.set_threadpool(pool_builder.build());
@@ -181,6 +183,8 @@ struct DynamicIndexVamana : public DynamicIndex {
181183
}
182184
}
183185

186+
size_t get_num_threads() override { return index.get_num_threads(); }
187+
184188
void set_num_threads(size_t num_threads) override {
185189
pool_builder.resize(num_threads);
186190
index.set_threadpool(pool_builder.build());

0 commit comments

Comments
 (0)