13 #include "GpuIndexIVF.h"
16 namespace faiss {
struct IndexIVFPQ; }
18 namespace faiss {
namespace gpu {
94 void reset()
override;
104 std::vector<unsigned char>
getListCodes(
int listId)
const;
126 void verifySettings_()
const;
128 void trainResidualQuantizer_(
Index::idx_t n,
const float* x);
140 size_t reserveMemoryVecs_;
std::vector< long > getListIndices(int listId) const
void searchImpl_(faiss::Index::idx_t n, const float *x, faiss::Index::idx_t k, float *distances, faiss::Index::idx_t *labels) const override
Called from GpuIndex for search.
bool usePrecomputedTables
GpuIndexIVFPQ(GpuResources *resources, const faiss::IndexIVFPQ *index, GpuIndexIVFPQConfig config=GpuIndexIVFPQConfig())
int getListLength(int listId) const
int getBitsPerCode() const
Return the number of bits per PQ code.
bool useFloat16LookupTables
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 addImpl_(faiss::Index::idx_t n, const float *x, const faiss::Index::idx_t *ids) override
Called from GpuIndex for add/add_with_ids.
void copyTo(faiss::IndexIVFPQ *index) const
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?
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