11 #include "GpuIndexIVF.h"
14 namespace faiss {
struct IndexIVFPQ; }
16 namespace faiss {
namespace gpu {
92 void reset()
override;
102 std::vector<unsigned char>
getListCodes(
int listId)
const;
122 void verifySettings_()
const;
124 void trainResidualQuantizer_(
Index::idx_t n,
const float* x);
136 size_t reserveMemoryVecs_;
std::vector< long > getListIndices(int listId) const
bool usePrecomputedTables
void addImpl_(int n, const float *x, const Index::idx_t *ids) override
Called from GpuIndex for add/add_with_ids.
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
long idx_t
all indices are this type
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)
void searchImpl_(int n, const float *x, int k, float *distances, Index::idx_t *labels) const override
Called from GpuIndex for search.
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 version and a L2 search version.
std::vector< unsigned char > getListCodes(int listId) const