Skip to content

Commit

Permalink
[Doc] Fix CAGRA search sample code (#484)
Browse files Browse the repository at this point in the history
`.view()` is required

Authors:
  - tsuki (https://github.com/enp1s0)

Approvers:
  - Micka (https://github.com/lowener)

URL: #484
  • Loading branch information
enp1s0 authored Nov 26, 2024
1 parent e1359e1 commit 5062594
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cpp/include/cuvs/neighbors/cagra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ struct index : cuvs::neighbors::index {
* // search K nearest neighbours
* auto neighbors = raft::make_device_matrix<uint32_t, int64_t>(res, n_queries, k);
* auto distances = raft::make_device_matrix<float, int64_t>(res, n_queries, k);
* cagra::search(res, search_params, index, queries, neighbors, distances);
* cagra::search(res, search_params, index, queries, neighbors.view(), distances.view());
* @endcode
* In the above example, we have passed a host dataset to build. The returned index will own a
* device copy of the dataset and the knn_graph. In contrast, if we pass the dataset as a
Expand Down Expand Up @@ -530,7 +530,7 @@ struct index : cuvs::neighbors::index {
* // search K nearest neighbours
* auto neighbors = raft::make_device_matrix<uint32_t>(res, n_queries, k);
* auto distances = raft::make_device_matrix<float>(res, n_queries, k);
* cagra::search(res, search_params, index, queries, neighbors, distances);
* cagra::search(res, search_params, index, queries, neighbors.view(), distances.view());
* @endcode
*
* @param[in] res
Expand Down Expand Up @@ -567,7 +567,7 @@ auto build(raft::resources const& res,
* // search K nearest neighbours
* auto neighbors = raft::make_device_matrix<uint32_t>(res, n_queries, k);
* auto distances = raft::make_device_matrix<float>(res, n_queries, k);
* cagra::search(res, search_params, index, queries, neighbors, distances);
* cagra::search(res, search_params, index, queries, neighbors.view(), distances.view());
* @endcode
*
* @param[in] res
Expand Down Expand Up @@ -604,7 +604,7 @@ auto build(raft::resources const& res,
* // search K nearest neighbours
* auto neighbors = raft::make_device_matrix<uint32_t>(res, n_queries, k);
* auto distances = raft::make_device_matrix<float>(res, n_queries, k);
* cagra::search(res, search_params, index, queries, neighbors, distances);
* cagra::search(res, search_params, index, queries, neighbors.view(), distances.view());
* @endcode
*
* @param[in] res
Expand Down Expand Up @@ -640,7 +640,7 @@ auto build(raft::resources const& res,
* // search K nearest neighbours
* auto neighbors = raft::make_device_matrix<uint32_t>(res, n_queries, k);
* auto distances = raft::make_device_matrix<float>(res, n_queries, k);
* cagra::search(res, search_params, index, queries, neighbors, distances);
* cagra::search(res, search_params, index, queries, neighbors.view(), distances.view());
* @endcode
*
* @param[in] res
Expand Down Expand Up @@ -676,7 +676,7 @@ auto build(raft::resources const& res,
* // search K nearest neighbours
* auto neighbors = raft::make_device_matrix<uint32_t>(res, n_queries, k);
* auto distances = raft::make_device_matrix<float>(res, n_queries, k);
* cagra::search(res, search_params, index, queries, neighbors, distances);
* cagra::search(res, search_params, index, queries, neighbors.view(), distances.view());
* @endcode
*
* @param[in] res
Expand Down Expand Up @@ -713,7 +713,7 @@ auto build(raft::resources const& res,
* // search K nearest neighbours
* auto neighbors = raft::make_device_matrix<uint32_t>(res, n_queries, k);
* auto distances = raft::make_device_matrix<float>(res, n_queries, k);
* cagra::search(res, search_params, index, queries, neighbors, distances);
* cagra::search(res, search_params, index, queries, neighbors.view(), distances.view());
* @endcode
*
* @param[in] res
Expand Down Expand Up @@ -750,7 +750,7 @@ auto build(raft::resources const& res,
* // search K nearest neighbours
* auto neighbors = raft::make_device_matrix<uint32_t>(res, n_queries, k);
* auto distances = raft::make_device_matrix<float>(res, n_queries, k);
* cagra::search(res, search_params, index, queries, neighbors, distances);
* cagra::search(res, search_params, index, queries, neighbors.view(), distances.view());
* @endcode
*
* @param[in] res
Expand Down Expand Up @@ -787,7 +787,7 @@ auto build(raft::resources const& res,
* // search K nearest neighbours
* auto neighbors = raft::make_device_matrix<uint32_t>(res, n_queries, k);
* auto distances = raft::make_device_matrix<float>(res, n_queries, k);
* cagra::search(res, search_params, index, queries, neighbors, distances);
* cagra::search(res, search_params, index, queries, neighbors.view(), distances.view());
* @endcode
*
* @param[in] res
Expand Down

0 comments on commit 5062594

Please sign in to comment.