Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
faiss::gpu::GpuIndexIVF Class Reference
Inheritance diagram for faiss::gpu::GpuIndexIVF:
faiss::gpu::GpuIndex faiss::Index faiss::gpu::GpuIndexIVFFlat faiss::gpu::GpuIndexIVFPQ

Public Member Functions

 GpuIndexIVF (GpuResources *resources, int device, IndicesOptions indicesOptions, bool useFloat16CoarseQuantizer, int dims, faiss::MetricType metric, int nlist)
 
 GpuIndexIVF (GpuResources *resources, int device, IndicesOptions indicesOptions, int dims, faiss::MetricType metric, int nlist, GpuIndexFlat *quantizer)
 
IndicesOptions getIndicesOptions () const
 What indices storage options are we using?
 
bool getUseFloat16CoarseQuantizer () const
 Is our coarse quantizer storing and performing math in float16?
 
void copyFrom (const faiss::IndexIVF *index)
 Copy what we need from the CPU equivalent.
 
void copyTo (faiss::IndexIVF *index) const
 Copy what we have to the CPU equivalent.
 
int getNumLists () const
 Returns the number of inverted lists we're managing.
 
void setNumProbes (int nprobe)
 Sets the number of list probes per query.
 
int getNumProbes () const
 Returns our current number of list probes per query.
 
void add (Index::idx_t n, const float *x) override
 
- Public Member Functions inherited from faiss::gpu::GpuIndex
 GpuIndex (GpuResources *resources, int device, int dims, faiss::MetricType metric)
 
int getDevice () const
 
GpuResourcesgetResources ()
 
- Public Member Functions inherited from faiss::Index
 Index (idx_t d=0, MetricType metric=METRIC_INNER_PRODUCT)
 
virtual void train (idx_t n, const float *x)
 
virtual void add_with_ids (idx_t n, const float *x, const long *xids)
 
virtual void search (idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) const =0
 
virtual void range_search (idx_t n, const float *x, float radius, RangeSearchResult *result) const
 
void assign (idx_t n, const float *x, idx_t *labels, idx_t k=1)
 
virtual void reset ()=0
 removes all elements from the database.
 
virtual long remove_ids (const IDSelector &sel)
 
virtual void reconstruct (idx_t key, float *recons) const
 
virtual void reconstruct_n (idx_t i0, idx_t ni, float *recons) const
 
void compute_residual (const float *x, float *residual, idx_t key) const
 
void display () const
 
virtual std::string get_typename () const
 
virtual void set_typename ()=0
 

Protected Member Functions

void trainQuantizer_ (faiss::Index::idx_t n, const float *x)
 

Protected Attributes

const IndicesOptions indicesOptions_
 How should indices be stored on the GPU?
 
const bool useFloat16CoarseQuantizer_
 
int nlist_
 Number of inverted lists that we manage.
 
int nprobe_
 Number of inverted list probes per query.
 
ClusteringParameters cp_
 Ability to override default clustering parameters.
 
GpuIndexFlatquantizer_
 Quantizer for inverted lists.
 
bool ownsQuantizer_
 Do we own the above quantizer instance?
 
- Protected Attributes inherited from faiss::gpu::GpuIndex
GpuResourcesresources_
 Manages streans, cuBLAS handles and scratch memory for devices.
 
int device_
 The GPU device we are resident on.
 

Additional Inherited Members

- Public Types inherited from faiss::Index
typedef long idx_t
 all indices are this type
 
- Public Attributes inherited from faiss::Index
std::string index_typename
 
int d
 vector dimension
 
idx_t ntotal
 total nb of indexed vectors
 
bool verbose
 verbosity level
 
bool is_trained
 set if the Index does not require training, or if training is done already
 
MetricType metric_type
 type of metric this index uses for search
 

Detailed Description

Definition at line 25 of file GpuIndexIVF.h.

Member Function Documentation

void faiss::gpu::GpuIndexIVF::add ( Index::idx_t  n,
const float *  x 
)
overridevirtual

x can be resident on the CPU or any GPU; the proper copies are performed Forwards to add_with_ids

Implements faiss::gpu::GpuIndex.

Definition at line 247 of file GpuIndexIVF.cu.

Member Data Documentation

const bool faiss::gpu::GpuIndexIVF::useFloat16CoarseQuantizer_
protected

Do we want to use float16 storage and math in our coarse quantizer?

Definition at line 85 of file GpuIndexIVF.h.


The documentation for this class was generated from the following files: