Skip to content
Closed
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
4 changes: 4 additions & 0 deletions faiss/gpu/GpuIndexCagra.cu
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ void GpuIndexCagra::train(idx_t n, const float* x) {
this->ntotal = n;
}

void GpuIndexCagra::add(idx_t n, const float* x) {
train(n, x);
}

bool GpuIndexCagra::addImplRequiresIDs_() const {
return false;
};
Expand Down
6 changes: 6 additions & 0 deletions faiss/gpu/GpuIndexCagra.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ struct GpuIndexCagra : public GpuIndex {
faiss::MetricType metric = faiss::METRIC_L2,
GpuIndexCagraConfig config = GpuIndexCagraConfig());

/// Trains CAGRA based on the given vector data and add them along with ids.
/// NB: The use of the add function here is to build the CAGRA graph on
/// the base dataset. Use this function when you want to add vectors with
/// ids. Ref: https://github.com/facebookresearch/faiss/issues/4107
void add(idx_t n, const float* x) override;

/// Trains CAGRA based on the given vector data.
/// NB: The use of the train function here is to build the CAGRA graph on
/// the base dataset and is currently the only function to add the full set
Expand Down
Loading