From ea9b1dfddaea29a81ca06fa6946f54b961180826 Mon Sep 17 00:00:00 2001 From: Ben Frederickson Date: Mon, 25 Sep 2023 16:08:53 -0700 Subject: [PATCH] doxygen fixes --- .../raft/neighbors/brute_force-ext.cuh | 23 +++++++++++-------- .../raft/neighbors/brute_force-inl.cuh | 19 +++++++-------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/cpp/include/raft/neighbors/brute_force-ext.cuh b/cpp/include/raft/neighbors/brute_force-ext.cuh index 3ae1855a31..5d70a42a26 100644 --- a/cpp/include/raft/neighbors/brute_force-ext.cuh +++ b/cpp/include/raft/neighbors/brute_force-ext.cuh @@ -23,7 +23,7 @@ #include // raft::resources #include // raft::distance::DistanceType #include -#include // RAFT_EXPLICIT +#include // RAFT_EXPLICIT #ifdef RAFT_EXPLICIT_INSTANTIATE_ONLY @@ -44,8 +44,8 @@ template , memory_type::host>> index build(raft::resources const& res, mdspan, row_major, Accessor> dataset, - raft::distance::DistanceType metric, - T metric_arg = 0.0) RAFT_EXPLICIT; + raft::distance::DistanceType metric = distance::DistanceType::L2Unexpanded, + T metric_arg = 0.0) RAFT_EXPLICIT; template void search(raft::resources const& res, @@ -109,25 +109,28 @@ instantiate_raft_neighbors_brute_force_knn( #undef instantiate_raft_neighbors_brute_force_knn -extern template void raft::neighbors::brute_force::search( +namespace raft::neighbors::brute_force { + +extern template void search( raft::resources const& res, const raft::neighbors::brute_force::index& idx, raft::device_matrix_view queries, raft::device_matrix_view neighbors, raft::device_matrix_view distances); -extern template void raft::neighbors::brute_force::search( +extern template void search( raft::resources const& res, const raft::neighbors::brute_force::index& idx, raft::device_matrix_view queries, raft::device_matrix_view neighbors, raft::device_matrix_view distances); -extern template raft::neighbors::brute_force::index raft::neighbors::brute_force::build< - float>(raft::resources const& res, - raft::device_matrix_view dataset, - raft::distance::DistanceType metric, - float metric_arg); +extern template raft::neighbors::brute_force::index build( + raft::resources const& res, + raft::device_matrix_view dataset, + raft::distance::DistanceType metric, + float metric_arg); +} // namespace raft::neighbors::brute_force #define instantiate_raft_neighbors_brute_force_fused_l2_knn( \ value_t, idx_t, idx_layout, query_layout) \ diff --git a/cpp/include/raft/neighbors/brute_force-inl.cuh b/cpp/include/raft/neighbors/brute_force-inl.cuh index 613e2bb2cc..2470156aed 100644 --- a/cpp/include/raft/neighbors/brute_force-inl.cuh +++ b/cpp/include/raft/neighbors/brute_force-inl.cuh @@ -287,8 +287,10 @@ void fused_l2_knn(raft::resources const& handle, * @tparam T data element type * * @param[in] res - * @param[in] params parameters for building the index * @param[in] dataset a matrix view (host or device) to a row-major matrix [n_rows, dim] + * @param[in] metric: distance metric to use. Euclidean (L2) is used by default + * @param[in] metric_arg: the value of `p` for Minkowski (l-p) distances. This + * is ignored if the metric_type is not Minkowski. * * @return the constructed brute force index */ @@ -297,8 +299,8 @@ template , memory_type::host>> index build(raft::resources const& res, mdspan, row_major, Accessor> dataset, - raft::distance::DistanceType metric, - T metric_arg = 0.0) + raft::distance::DistanceType metric = = distance::DistanceType::L2Unexpanded, + T metric_arg = 0.0) { auto ret = index(res, dataset, metric, metric_arg); @@ -336,7 +338,6 @@ index build(raft::resources const& res, * @tparam IdxT type of the indices * * @param[in] res raft resources - * @param[in] params configure the search * @param[in] idx brute force index * @param[in] queries a device matrix view to a row-major matrix [n_queries, index->dim()] * @param[out] neighbors a device matrix view to the indices of the neighbors in the source dataset @@ -347,13 +348,13 @@ index build(raft::resources const& res, template void search(raft::resources const& res, const index& idx, - raft::device_matrix_view query, + raft::device_matrix_view queries, raft::device_matrix_view neighbors, raft::device_matrix_view distances) { RAFT_EXPECTS(neighbors.extent(1) == distances.extent(1), "Value of k must match for outputs"); - RAFT_EXPECTS(idx.dataset().extent(1) == query.extent(1), - "Number of columns in query must match brute force index"); + RAFT_EXPECTS(idx.dataset().extent(1) == queries.extent(1), + "Number of columns in queries must match brute force index"); auto k = neighbors.extent(1); auto d = idx.dataset().extent(1); @@ -367,8 +368,8 @@ void search(raft::resources const& res, dataset, sizes, d, - const_cast(query.data_handle()), - query.extent(0), + const_cast(queries.data_handle()), + queries.extent(0), neighbors.data_handle(), distances.data_handle(), k,