Skip to content

Commit

Permalink
Merge branch 'add_batch_vid_dis' of github.com:Carrot-77/vsag into ad…
Browse files Browse the repository at this point in the history
…d_batch_vid_dis
  • Loading branch information
zourunxin.zrx committed Jan 20, 2025
2 parents 13ea121 + 072c929 commit 959db4a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/algorithm/hnswlib/hnswalg_static.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,19 @@ class StaticHierarchicalNSW : public AlgorithmInterface<float> {
>>>>>>> 03dc3f6... fix asan issue in multi-threading (#335)
}

void
copyDataByLabel(LabelType label, void* data_point) override {
std::unique_lock lock_table(label_lookup_lock);

auto search = label_lookup_.find(label);
if (search == label_lookup_.end() || isMarkedDeleted(search->second)) {
throw std::runtime_error("Label not found");
}
InnerIdType internal_id = search->second;

memcpy(data_point, getDataByInternalId(internal_id), data_size_);
}

bool
isValidLabel(LabelType label) override {
std::unique_lock<std::mutex> lock_table(label_lookup_lock);
Expand Down

0 comments on commit 959db4a

Please sign in to comment.