Struct faiss::gpu::GpuDistanceParams

struct faiss::gpu::GpuDistanceParams

Arguments to brute-force GPU k-nearest neighbor searching.

Public Functions

inline GpuDistanceParams()

Public Members

faiss::MetricType metric

Search parameter: distance metric.

float metricArg

Search parameter: distance metric argument (if applicable) For metric == METRIC_Lp, this is the p-value

int k

Search parameter: return k nearest neighbors If the value provided is -1, then we report all pairwise distances without top-k filtering

int dims

Vector dimensionality.

const void *vectors

If vectorsRowMajor is true, this is numVectors x dims, with dims innermost; otherwise, dims x numVectors, with numVectors innermost

DistanceDataType vectorType
bool vectorsRowMajor
int numVectors
const float *vectorNorms

Precomputed L2 norms for each vector in vectors, which can be optionally provided in advance to speed computation for METRIC_L2

const void *queries

If queriesRowMajor is true, this is numQueries x dims, with dims innermost; otherwise, dims x numQueries, with numQueries innermost

DistanceDataType queryType
bool queriesRowMajor
int numQueries
float *outDistances

A region of memory size numQueries x k, with k innermost (row major) if k > 0, or if k == -1, a region of memory of size numQueries x numVectors

bool ignoreOutDistances

Do we only care about the indices reported, rather than the output distances? Not used if k == -1 (all pairwise distances)

IndicesDataType outIndicesType

A region of memory size numQueries x k, with k innermost (row major). Not used if k == -1 (all pairwise distances)

void *outIndices