Implementing class for IVFPQ on the GPU.
More...
|
| IVFPQ (GpuResources *resources, FlatIndex *quantizer, int numSubQuantizers, int bitsPerSubQuantizer, float *pqCentroidData, IndicesOptions indicesOptions, bool useFloat16LookupTables, MemorySpace space) |
|
void | setPrecomputedCodes (bool enable) |
| Enable or disable pre-computed codes.
|
|
void | addCodeVectorsFromCpu (int listId, const void *codes, const long *indices, size_t numVecs) |
|
int | classifyAndAddVectors (Tensor< float, 2, true > &vecs, Tensor< long, 1, true > &indices) |
|
void | query (Tensor< float, 2, true > &queries, int nprobe, int k, Tensor< float, 2, true > &outDistances, Tensor< long, 2, true > &outIndices) |
|
std::vector< unsigned char > | getListCodes (int listId) const |
| Return the list codes of a particular list back to the CPU.
|
|
Tensor< float, 3, true > | getPQCentroids () |
|
| IVFBase (GpuResources *resources, FlatIndex *quantizer, int bytesPerVector, IndicesOptions indicesOptions, MemorySpace space) |
|
void | reserveMemory (size_t numVecs) |
| Reserve GPU memory in our inverted lists for this number of vectors.
|
|
void | reset () |
|
int | getDim () const |
| Return the number of dimensions we are indexing.
|
|
size_t | reclaimMemory () |
|
size_t | getNumLists () const |
| Returns the number of inverted lists.
|
|
int | getListLength (int listId) const |
|
std::vector< long > | getListIndices (int listId) const |
| Return the list indices of a particular list back to the CPU.
|
|
Implementing class for IVFPQ on the GPU.
Definition at line 17 of file IVFPQ.cuh.
faiss::gpu::IVFPQ::IVFPQ |
( |
GpuResources * |
resources, |
|
|
FlatIndex * |
quantizer, |
|
|
int |
numSubQuantizers, |
|
|
int |
bitsPerSubQuantizer, |
|
|
float * |
pqCentroidData, |
|
|
IndicesOptions |
indicesOptions, |
|
|
bool |
useFloat16LookupTables, |
|
|
MemorySpace |
space |
|
) |
| |
- Parameters
-
quantizer | We do not own this reference |
Definition at line 33 of file IVFPQ.cu.
void faiss::gpu::IVFPQ::addCodeVectorsFromCpu |
( |
int |
listId, |
|
|
const void * |
codes, |
|
|
const long * |
indices, |
|
|
size_t |
numVecs |
|
) |
| |
Adds a set of codes and indices to a list; the data can be resident on either the host or the device
Definition at line 345 of file IVFPQ.cu.
int faiss::gpu::IVFPQ::classifyAndAddVectors |
( |
Tensor< float, 2, true > & |
vecs, |
|
|
Tensor< long, 1, true > & |
indices |
|
) |
| |
Calcuates the residual and quantizes the vectors, adding them to this index The input data must be on our current device. Returns the number of vectors successfully added. Vectors may not be able to be added because they contain NaNs.
Definition at line 118 of file IVFPQ.cu.
Tensor< float, 3, true > faiss::gpu::IVFPQ::getPQCentroids |
( |
| ) |
|
Returns our set of sub-quantizers of the form (sub q)(code id)(sub dim)
Definition at line 591 of file IVFPQ.cu.
bool faiss::gpu::IVFPQ::isSupportedNoPrecomputedSubDimSize |
( |
int |
dims | ) |
|
|
static |
For no precomputed codes, is this a supported sub-dimension size? FIXME: get MM implementation working again
Definition at line 95 of file IVFPQ.cu.
void faiss::gpu::IVFPQ::query |
( |
Tensor< float, 2, true > & |
queries, |
|
|
int |
nprobe, |
|
|
int |
k, |
|
|
Tensor< float, 2, true > & |
outDistances, |
|
|
Tensor< long, 2, true > & |
outIndices |
|
) |
| |
Find the approximate k nearest neigbors for queries
against our database
Definition at line 516 of file IVFPQ.cu.
The documentation for this class was generated from the following files: