Functions
knn_api.h File Reference
#include <cuml/cuml_api.h>
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for knn_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

cumlError_t knn_search (const cumlHandle_t handle, float **input, int *size, int n_params, int D, float *search_items, int n, int64_t *res_I, float *res_D, int k, bool rowMajorIndex, bool rowMajorQuery, int metric_type, float metric_arg, bool expanded)
 Flat C API function to perform a brute force knn on a series of input arrays and combine the results into a single output array for indexes and distances. More...
 

Function Documentation

◆ knn_search()

cumlError_t knn_search ( const cumlHandle_t  handle,
float **  input,
int *  size,
int  n_params,
int  D,
float *  search_items,
int  n,
int64_t *  res_I,
float *  res_D,
int  k,
bool  rowMajorIndex,
bool  rowMajorQuery,
int  metric_type,
float  metric_arg,
bool  expanded 
)

Flat C API function to perform a brute force knn on a series of input arrays and combine the results into a single output array for indexes and distances.

Parameters
[in]handlethe cuml handle to use
[in]inputan array of pointers to the input arrays
[in]sizean array of sizes of input arrays
[in]n_paramsarray size of input and sizes
[in]Dthe dimensionality of the arrays
[in]search_itemsarray of items to search of dimensionality D
[in]nnumber of rows in search_items
[out]res_Ithe resulting index array of size n * k
[out]res_Dthe resulting distance array of size n * k
[in]kthe number of nearest neighbors to return
[in]rowMajorIndexis the index array in row major layout?
[in]rowMajorQueryis the query array in row major layout?
[in]metric_typethe type of distance metric to use. This corresponds to the value in the cuvs::distance::DistanceType enum. Default is Euclidean (L2).
[in]metric_argthe value of p for Minkowski (l-p) distances. This is ignored if the metric_type is not Minkowski.
[in]expandedshould lp-based distances be returned in their expanded form (e.g., without raising to the 1/p power).