21 namespace faiss {
namespace gpu {
80 void reset()
override;
96 float* out)
const override;
119 void verifySettings_()
const;
bool useFloat16Accumulator
void copyFrom(faiss::IndexFlatL2 *index)
void copyTo(faiss::IndexFlat *index) const
void reconstruct_n(faiss::Index::idx_t i0, faiss::Index::idx_t num, float *out) const override
Batch reconstruction method.
Holder of GPU resources for a particular flat index.
FlatIndex * getGpuData()
For internal access.
void copyTo(faiss::IndexFlatL2 *index)
size_t getNumVecs() const
Returns the number of vectors we contain.
void searchImpl_(int n, const float *x, int k, float *distances, faiss::Index::idx_t *labels) const override
Called from GpuIndex for search.
GpuIndexFlat(GpuResources *resources, const faiss::IndexFlat *index, GpuIndexFlatConfig config=GpuIndexFlatConfig())
bool useFloat16
Whether or not data is stored as float16.
GpuIndexFlatL2(GpuResources *resources, faiss::IndexFlatL2 *index, GpuIndexFlatConfig config=GpuIndexFlatConfig())
long idx_t
all indices are this type
void reconstruct(faiss::Index::idx_t key, float *out) const override
void copyTo(faiss::IndexFlatIP *index)
GpuIndexFlatIP(GpuResources *resources, faiss::IndexFlatIP *index, GpuIndexFlatConfig config=GpuIndexFlatConfig())
void addImpl_(int n, const float *x, const Index::idx_t *ids) override
Called from GpuIndex for add.
void copyFrom(const faiss::IndexFlat *index)
bool addImplRequiresIDs_() const override
Flat index does not require IDs as there is no storage available for them.
const GpuIndexFlatConfig config_
Our config object.
void add(faiss::Index::idx_t, const float *x) override
Overrides to avoid excessive copies.
void reset() override
Clears all vectors from this index.
void copyFrom(faiss::IndexFlatIP *index)
void train(Index::idx_t n, const float *x) override
This index is not trained, so this does nothing.
MetricType
Some algorithms support both an inner product version and a L2 search version.