#include <GpuIndexFlat.h>
Public Member Functions | |
GpuIndexFlatIP (GpuResources *resources, int device, bool useFloat16, faiss::IndexFlatIP *index) | |
GpuIndexFlatIP (GpuResources *resources, int device, int dims, bool useFloat16) | |
Construct an empty instance that can be added to. | |
void | copyFrom (faiss::IndexFlatIP *index) |
void | copyTo (faiss::IndexFlatIP *index) |
![]() | |
GpuIndexFlat (GpuResources *resources, int device, bool useFloat16, const faiss::IndexFlat *index) | |
GpuIndexFlat (GpuResources *resources, int device, int dims, bool useFloat16, faiss::MetricType metric) | |
Construct an empty instance that can be added to. | |
void | setMinPagingSize (size_t size) |
size_t | getMinPagingSize () const |
Returns the current minimum data size for paged searches. | |
bool | getUseFloat16 () const |
Do we store vectors and perform math in float16? | |
void | copyFrom (const faiss::IndexFlat *index) |
void | copyTo (faiss::IndexFlat *index) const |
size_t | getNumVecs () const |
Returns the number of vectors we contain. | |
void | reset () override |
Clears all vectors from this index. | |
void | train (Index::idx_t n, const float *x) override |
This index is not trained, so this does nothing. | |
void | add (Index::idx_t n, const float *x) 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 |
void | reconstruct (faiss::Index::idx_t key, float *out) const override |
void | reconstruct_n (faiss::Index::idx_t i0, faiss::Index::idx_t num, float *out) const override |
Batch reconstruction method. | |
void | set_typename () override |
FlatIndex * | getGpuData () |
For internal access. | |
![]() | |
GpuIndex (GpuResources *resources, int device, int dims, faiss::MetricType metric) | |
int | getDevice () const |
GpuResources * | getResources () |
![]() | |
Index (idx_t d=0, MetricType metric=METRIC_INNER_PRODUCT) | |
virtual void | add_with_ids (idx_t n, const float *x, const long *xids) |
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 long | remove_ids (const IDSelector &sel) |
void | compute_residual (const float *x, float *residual, idx_t key) const |
void | display () const |
virtual std::string | get_typename () const |
Additional Inherited Members | |
![]() | |
typedef long | idx_t |
all indices are this type | |
![]() | |
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 | |
![]() | |
void | searchFromCpuPaged_ (int n, const float *x, int k, float *outDistancesData, int *outIndicesData) const |
void | searchNonPaged_ (int n, const float *x, int k, float *outDistancesData, int *outIndicesData) const |
![]() | |
size_t | minPagedSize_ |
Size above which we page copies from the CPU to GPU. | |
const bool | useFloat16_ |
Whether or not we store our vectors in float32 or float16. | |
FlatIndex * | data_ |
Holds our GPU data containing the list of vectors. | |
![]() | |
GpuResources * | resources_ |
Manages streans, cuBLAS handles and scratch memory for devices. | |
int | device_ |
The GPU device we are resident on. | |
Wrapper around the GPU implementation that looks like faiss::IndexFlatIP; copies over centroid data from a given faiss::IndexFlat
Definition at line 158 of file GpuIndexFlat.h.
faiss::gpu::GpuIndexFlatIP::GpuIndexFlatIP | ( | GpuResources * | resources, |
int | device, | ||
bool | useFloat16, | ||
faiss::IndexFlatIP * | index | ||
) |
Construct from a pre-existing faiss::IndexFlatIP instance, copying data over to the given GPU
Definition at line 516 of file GpuIndexFlat.cu.
void faiss::gpu::GpuIndexFlatIP::copyFrom | ( | faiss::IndexFlatIP * | index | ) |
Initialize ourselves from the given CPU index; will overwrite all data in ourselves
Definition at line 532 of file GpuIndexFlat.cu.
void faiss::gpu::GpuIndexFlatIP::copyTo | ( | faiss::IndexFlatIP * | index | ) |
Copy ourselves to the given CPU index; will overwrite all data in the index instance
Definition at line 537 of file GpuIndexFlat.cu.