14 #include "utils/MemorySpace.h"
16 namespace faiss {
namespace gpu {
42 int getDevice()
const {
void search(faiss::Index::idx_t n, const float *x, faiss::Index::idx_t k, float *distances, faiss::Index::idx_t *labels) const override
virtual void searchImpl_(faiss::Index::idx_t n, const float *x, faiss::Index::idx_t k, float *distances, faiss::Index::idx_t *labels) const =0
Overridden to actually perform the search.
void addInternal_(Index::idx_t n, const float *x, const Index::idx_t *ids)
int device
GPU device on which the index is resident.
void add_with_ids(Index::idx_t n, const float *x, const Index::idx_t *ids) override
const int device_
The GPU device we are resident on.
GpuResources * resources_
Manages streans, cuBLAS handles and scratch memory for devices.
long idx_t
all indices are this type
virtual void addImpl_(Index::idx_t n, const float *x, const Index::idx_t *ids)=0
Overridden to actually perform the add.
void add(faiss::Index::idx_t, const float *x) override
const MemorySpace memorySpace_
The memory space of our primary storage on the GPU.
MetricType
Some algorithms support both an inner product vetsion and a L2 search version.