@@ -2335,6 +2335,124 @@ void extend(const raft::resources& clique,
23352335
23362336// / \defgroup mg_cpp_index_search ANN MG index search
23372337
2338+ // / \ingroup mg_cpp_index_search
2339+ /* *
2340+ * @brief Searches a multi-GPU index
2341+ *
2342+ * Usage example:
2343+ * @code{.cpp}
2344+ * raft::device_resources_snmg clique;
2345+ * cuvs::neighbors::mg_index_params<cagra::index_params> index_params;
2346+ * auto index = cuvs::neighbors::cagra::build(clique, index_params, index_dataset);
2347+ * cuvs::neighbors::mg_search_params<cagra::search_params> search_params;
2348+ * cuvs::neighbors::cagra::search(clique, index, search_params, queries, neighbors,
2349+ * distances);
2350+ * @endcode
2351+ *
2352+ * @param[in] clique a `raft::resources` object specifying the NCCL clique configuration
2353+ * @param[in] index the pre-built index
2354+ * @param[in] search_params configure the index search
2355+ * @param[in] queries a row-major matrix on host [n_rows, dim]
2356+ * @param[out] neighbors a row-major matrix on host [n_rows, n_neighbors]
2357+ * @param[out] distances a row-major matrix on host [n_rows, n_neighbors]
2358+ *
2359+ */
2360+ void search (const raft::resources& clique,
2361+ const cuvs::neighbors::mg_index<cagra::index<float , uint32_t >, float , uint32_t >& index,
2362+ const cuvs::neighbors::mg_search_params<cagra::search_params>& search_params,
2363+ raft::host_matrix_view<const float , int64_t , row_major> queries,
2364+ raft::host_matrix_view<int64_t , int64_t , row_major> neighbors,
2365+ raft::host_matrix_view<float , int64_t , row_major> distances);
2366+
2367+ // / \ingroup mg_cpp_index_search
2368+ /* *
2369+ * @brief Searches a multi-GPU index
2370+ *
2371+ * Usage example:
2372+ * @code{.cpp}
2373+ * raft::device_resources_snmg clique;
2374+ * cuvs::neighbors::mg_index_params<cagra::index_params> index_params;
2375+ * auto index = cuvs::neighbors::cagra::build(clique, index_params, index_dataset);
2376+ * cuvs::neighbors::mg_search_params<cagra::search_params> search_params;
2377+ * cuvs::neighbors::cagra::search(clique, index, search_params, queries, neighbors,
2378+ * distances);
2379+ * @endcode
2380+ *
2381+ * @param[in] clique a `raft::resources` object specifying the NCCL clique configuration
2382+ * @param[in] index the pre-built index
2383+ * @param[in] search_params configure the index search
2384+ * @param[in] queries a row-major matrix on host [n_rows, dim]
2385+ * @param[out] neighbors a row-major matrix on host [n_rows, n_neighbors]
2386+ * @param[out] distances a row-major matrix on host [n_rows, n_neighbors]
2387+ *
2388+ */
2389+ void search (const raft::resources& clique,
2390+ const cuvs::neighbors::mg_index<cagra::index<half, uint32_t >, half, uint32_t >& index,
2391+ const cuvs::neighbors::mg_search_params<cagra::search_params>& search_params,
2392+ raft::host_matrix_view<const half, int64_t , row_major> queries,
2393+ raft::host_matrix_view<int64_t , int64_t , row_major> neighbors,
2394+ raft::host_matrix_view<float , int64_t , row_major> distances);
2395+
2396+ // / \ingroup mg_cpp_index_search
2397+ /* *
2398+ * @brief Searches a multi-GPU index
2399+ *
2400+ * Usage example:
2401+ * @code{.cpp}
2402+ * raft::device_resources_snmg clique;
2403+ * cuvs::neighbors::mg_index_params<cagra::index_params> index_params;
2404+ * auto index = cuvs::neighbors::cagra::build(clique, index_params, index_dataset);
2405+ * cuvs::neighbors::mg_search_params<cagra::search_params> search_params;
2406+ * cuvs::neighbors::cagra::search(clique, index, search_params, queries, neighbors,
2407+ * distances);
2408+ * @endcode
2409+ *
2410+ * @param[in] clique a `raft::resources` object specifying the NCCL clique configuration
2411+ * @param[in] index the pre-built index
2412+ * @param[in] search_params configure the index search
2413+ * @param[in] queries a row-major matrix on host [n_rows, dim]
2414+ * @param[out] neighbors a row-major matrix on host [n_rows, n_neighbors]
2415+ * @param[out] distances a row-major matrix on host [n_rows, n_neighbors]
2416+ *
2417+ */
2418+ void search (
2419+ const raft::resources& clique,
2420+ const cuvs::neighbors::mg_index<cagra::index<int8_t , uint32_t >, int8_t , uint32_t >& index,
2421+ const cuvs::neighbors::mg_search_params<cagra::search_params>& search_params,
2422+ raft::host_matrix_view<const int8_t , int64_t , row_major> queries,
2423+ raft::host_matrix_view<int64_t , int64_t , row_major> neighbors,
2424+ raft::host_matrix_view<float , int64_t , row_major> distances);
2425+
2426+ // / \ingroup mg_cpp_index_search
2427+ /* *
2428+ * @brief Searches a multi-GPU index
2429+ *
2430+ * Usage example:
2431+ * @code{.cpp}
2432+ * raft::device_resources_snmg clique;
2433+ * cuvs::neighbors::mg_index_params<cagra::index_params> index_params;
2434+ * auto index = cuvs::neighbors::cagra::build(clique, index_params, index_dataset);
2435+ * cuvs::neighbors::mg_search_params<cagra::search_params> search_params;
2436+ * cuvs::neighbors::cagra::search(clique, index, search_params, queries, neighbors,
2437+ * distances);
2438+ * @endcode
2439+ *
2440+ * @param[in] clique a `raft::resources` object specifying the NCCL clique configuration
2441+ * @param[in] index the pre-built index
2442+ * @param[in] search_params configure the index search
2443+ * @param[in] queries a row-major matrix on host [n_rows, dim]
2444+ * @param[out] neighbors a row-major matrix on host [n_rows, n_neighbors]
2445+ * @param[out] distances a row-major matrix on host [n_rows, n_neighbors]
2446+ *
2447+ */
2448+ void search (
2449+ const raft::resources& clique,
2450+ const cuvs::neighbors::mg_index<cagra::index<uint8_t , uint32_t >, uint8_t , uint32_t >& index,
2451+ const cuvs::neighbors::mg_search_params<cagra::search_params>& search_params,
2452+ raft::host_matrix_view<const uint8_t , int64_t , row_major> queries,
2453+ raft::host_matrix_view<int64_t , int64_t , row_major> neighbors,
2454+ raft::host_matrix_view<float , int64_t , row_major> distances);
2455+
23382456// / \ingroup mg_cpp_index_search
23392457/* *
23402458 * @brief Searches a multi-GPU index
0 commit comments