Faiss

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | List of all members
faiss::gpu::GpuIndexFlatL2 Class Reference

`#include <GpuIndexFlat.h>`

Inheritance diagram for faiss::gpu::GpuIndexFlatL2:

## Public Member Functions
| GpuIndexFlatL2 (GpuResources *resources, faiss::IndexFlatL2 *index, GpuIndexFlatConfig config=GpuIndexFlatConfig())
| GpuIndexFlatL2 (GpuResources *resources, int dims, GpuIndexFlatConfig config=GpuIndexFlatConfig())
| Construct an empty instance that can be added to.
void | copyFrom (faiss::IndexFlatL2 *index)
void | copyTo (faiss::IndexFlatL2 *index)
Public Member Functions inherited from faiss::gpu::GpuIndexFlat
| GpuIndexFlat (GpuResources *resources, const faiss::IndexFlat *index, GpuIndexFlatConfig config=GpuIndexFlatConfig())
| GpuIndexFlat (GpuResources *resources, int dims, faiss::MetricType metric, GpuIndexFlatConfig config=GpuIndexFlatConfig())
| 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.
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 (faiss::Index::idx_t, const float *x) override
| Overrides to avoid excessive copies.
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.
FlatIndex * | getGpuData ()
| For internal access.
Public Member Functions inherited from faiss::gpu::GpuIndex
| GpuIndex (GpuResources *resources, int dims, faiss::MetricType metric, GpuIndexConfig config)
int | getDevice () const
GpuResources * | getResources ()
void | add_with_ids (Index::idx_t n, const float *x, const Index::idx_t *ids) override
Public Member Functions inherited from faiss::Index
| Index (idx_t d=0, MetricType metric=METRIC_INNER_PRODUCT)
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

## Additional Inherited Members
Public Types inherited from faiss::Index
typedef long | idx_t
| all indices are this type
Public Attributes inherited from faiss::Index
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
Protected Member Functions inherited from faiss::gpu::GpuIndexFlat
void | addImpl_ (faiss::Index::idx_t n, const float *x, const faiss::Index::idx_t *ids) override
| Called from GpuIndex for add.
void | searchImpl_ (faiss::Index::idx_t n, const float *x, faiss::Index::idx_t k, float *distances, faiss::Index::idx_t *labels) const override
| Should not be called (we have our own implementation)
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
Protected Member Functions inherited from faiss::gpu::GpuIndex
void | addInternal_ (Index::idx_t n, const float *x, const Index::idx_t *ids)
Protected Attributes inherited from faiss::gpu::GpuIndexFlat
const GpuIndexFlatConfig | config_
| Our config object.
size_t | minPagedSize_
| Size above which we page copies from the CPU to GPU.
FlatIndex * | data_
| Holds our GPU data containing the list of vectors.
Protected Attributes inherited from faiss::gpu::GpuIndex
GpuResources * | resources_
| Manages streans, cuBLAS handles and scratch memory for devices.
const int | device_
| The GPU device we are resident on.
const MemorySpace | memorySpace_
| The memory space of our primary storage on the GPU.

## Detailed Description

Wrapper around the GPU implementation that looks like faiss::IndexFlatL2; copies over centroid data from a given faiss::IndexFlat

Definition at line 169 of file GpuIndexFlat.h.

## Constructor & Destructor Documentation

faiss::gpu::GpuIndexFlatL2::GpuIndexFlatL2 | ( | GpuResources * | resources,
|  | faiss::IndexFlatL2 * | index,
|  | GpuIndexFlatConfig | config = `GpuIndexFlatConfig()`
| ) |  |

Construct from a pre-existing faiss::IndexFlatL2 instance, copying data over to the given GPU

Definition at line 549 of file GpuIndexFlat.cu.

## Member Function Documentation

void faiss::gpu::GpuIndexFlatL2::copyFrom | ( | faiss::IndexFlatL2 * | index | ) |

Initialize ourselves from the given CPU index; will overwrite all data in ourselves

Definition at line 562 of file GpuIndexFlat.cu.

void faiss::gpu::GpuIndexFlatL2::copyTo | ( | faiss::IndexFlatL2 * | index | ) |

Copy ourselves to the given CPU index; will overwrite all data in the index instance

Definition at line 567 of file GpuIndexFlat.cu.

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

- /data/users/matthijs/github_faiss/faiss/gpu/GpuIndexFlat.h
- /data/users/matthijs/github_faiss/faiss/gpu/GpuIndexFlat.cu