Skip to content

Commit

Permalink
Fix unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
small-turtle-1 committed Dec 25, 2024
1 parent 4f6b07d commit 2a5a20e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public:

T *get() const { return ptr_.get(); }

UniquePtr<T[]> exchange(UniquePtr<T[]> ptr) { return std::exchange(ptr_, std::move(ptr)); }

private:
UniquePtr<T[]> ptr_;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public:
for (SizeT i = 0; i < this->dim_; ++i) {
new_mean[i] /= cur_vec_num;
}
this->mean_ = std::move(new_mean);
new_mean = this->mean_.exchange(std::move(new_mean)); //

for (auto [inner, size] : inners) {
for (SizeT i = 0; i < size; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion src/unit_test/storage/knnindex/knn_hnsw/test_hnsw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class HnswAlgTest : public BaseTest {
int dim = 16;
int M = 8;
int ef_construction = 200;
int chunk_size = 16;
int chunk_size = 128;
int max_chunk_n = 10;
int element_size = max_chunk_n * chunk_size;

Expand Down

0 comments on commit 2a5a20e

Please sign in to comment.