14 #include "GpuIndexIVF.h"
17 namespace faiss {
struct IndexIVFPQ; }
19 namespace faiss {
namespace gpu {
31 IndicesOptions indicesOptions,
32 bool useFloat16LookupTables,
43 IndicesOptions indicesOptions,
44 bool useFloat16LookupTables,
87 void reset()
override;
105 void set_typename()
override;
113 std::vector<unsigned char>
getListCodes(
int listId)
const;
120 void assertSettings_()
const;
122 void trainResidualQuantizer_(
Index::idx_t n,
const float* x);
126 const bool useFloat16LookupTables_;
135 bool usePrecomputed_;
138 size_t reserveMemoryVecs_;
std::vector< long > getListIndices(int listId) const
int getListLength(int listId) const
int getBitsPerCode() const
Return the number of bits per PQ code.
void train(Index::idx_t n, const float *x) override
void reserveMemory(size_t numVecs)
Reserve GPU memory in our inverted lists for this number of vectors.
void copyFrom(const faiss::IndexIVFPQ *index)
long idx_t
all indices are this type
void copyTo(faiss::IndexIVFPQ *index) const
bool getFloat16LookupTables() const
Are float16 residual distance lookup tables enabled?
void add_with_ids(Index::idx_t n, const float *x, const Index::idx_t *xids) override
void search(faiss::Index::idx_t n, const float *x, faiss::Index::idx_t k, float *distances, faiss::Index::idx_t *labels) const override
int getNumSubQuantizers() const
Return the number of sub-quantizers we are using.
int getCentroidsPerSubQuantizer() const
Return the number of centroids per PQ code (2^bits per code)
void setPrecomputedCodes(bool enable)
Enable or disable pre-computed codes.
bool getPrecomputedCodes() const
Are pre-computed codes enabled?
GpuIndexIVFPQ(GpuResources *resources, int device, IndicesOptions indicesOptions, bool useFloat16LookupTables, const faiss::IndexIVFPQ *index)
Implementing class for IVFPQ on the GPU.
MetricType
Some algorithms support both an inner product vetsion and a L2 search version.
std::vector< unsigned char > getListCodes(int listId) const