#include <cuml/cuml_api.h>
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
|
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...
|
|
◆ 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] | handle | the cuml handle to use |
[in] | input | an array of pointers to the input arrays |
[in] | size | an array of sizes of input arrays |
[in] | n_params | array size of input and sizes |
[in] | D | the dimensionality of the arrays |
[in] | search_items | array of items to search of dimensionality D |
[in] | n | number of rows in search_items |
[out] | res_I | the resulting index array of size n * k |
[out] | res_D | the resulting distance array of size n * k |
[in] | k | the number of nearest neighbors to return |
[in] | rowMajorIndex | is the index array in row major layout? |
[in] | rowMajorQuery | is the query array in row major layout? |
[in] | metric_type | the type of distance metric to use. This corresponds to the value in the raft::distance::DistanceType enum. Default is Euclidean (L2). |
[in] | metric_arg | the value of p for Minkowski (l-p) distances. This is ignored if the metric_type is not Minkowski. |
[in] | expanded | should lp-based distances be returned in their expanded form (e.g., without raising to the 1/p power). |