pub unsafe extern "C" fn cuvsCagraMerge(
res: cuvsResources_t,
params: cuvsCagraIndexParams_t,
indices: *mut cuvsCagraIndex_t,
num_indices: usize,
filter: cuvsFilter,
output_index: cuvsCagraIndex_t,
) -> cuvsError_tExpand description
@brief Merge multiple CAGRA indices into a single CAGRA index.
All input indices must have been built with the same data type (index.dtype) and
have the same dimensionality (index.dims). The merged index uses the output
parameters specified in cuvsCagraIndexParams.
Input indices must have:
index.dtype.codeandindex.dtype.bitsmatching across all indices.- Supported data types for indices:
a.
kDLFloatwithbits = 32b.kDLFloatwithbits = 16c.kDLIntwithbits = 8d.kDLUIntwithbits = 8
The resulting output index will have the same data type as the input indices.
Example: @code{.c} #include <cuvs/core/c_api.h> #include <cuvs/neighbors/cagra.h>
cuvsResources_t res; cuvsError_t res_create_status = cuvsResourcesCreate(&res);
cuvsCagraIndex_t index1, index2, merged_index; cuvsCagraIndexCreate(&index1); cuvsCagraIndexCreate(&index2); cuvsCagraIndexCreate(&merged_index);
// Assume index1 and index2 have been built using cuvsCagraBuild
cuvsCagraIndexParams_t merge_params; cuvsError_t params_create_status = cuvsCagraIndexParamsCreate(&merge_params);
cuvsError_t merge_status = cuvsCagraMerge(res, merge_params, (cuvsCagraIndex_t[]){index1, index2}, 2, merged_index);
// Use merged_index for search operations
cuvsError_t params_destroy_status = cuvsCagraIndexParamsDestroy(merge_params); cuvsError_t res_destroy_status = cuvsResourcesDestroy(res); @endcode
@param[in] res cuvsResources_t opaque C handle
@param[in] params cuvsCagraIndexParams_t parameters controlling merge behavior
@param[in] indices Array of input cuvsCagraIndex_t handles to merge
@param[in] num_indices Number of input indices
@param[in] filter Filter that can be used to filter out vectors from the merged index
@param[out] output_index Output handle that will store the merged index.
Must be initialized using cuvsCagraIndexCreate before use.