From b369dd71440dbbd5405af782e2db6cafd5b54d91 Mon Sep 17 00:00:00 2001 From: enp1s0 Date: Thu, 5 Dec 2024 22:41:46 +0900 Subject: [PATCH 1/2] Fix sample codes --- cpp/include/raft/cluster/kmeans.cuh | 6 +++--- cpp/include/raft/comms/std_comms.hpp | 4 ++-- cpp/include/raft/distance/distance-inl.cuh | 2 +- cpp/include/raft/neighbors/epsilon_neighborhood.cuh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpp/include/raft/cluster/kmeans.cuh b/cpp/include/raft/cluster/kmeans.cuh index 38318e8ec8..fa5db93a64 100644 --- a/cpp/include/raft/cluster/kmeans.cuh +++ b/cpp/include/raft/cluster/kmeans.cuh @@ -52,7 +52,7 @@ using KeyValueIndexOp = detail::KeyValueIndexOp; * #include * using namespace raft::cluster; * ... - * raft::raft::resources handle; + * raft::resources handle; * raft::cluster::KMeansParams params; * int n_features = 15, inertia, n_iter; * auto centroids = raft::make_device_matrix(handle, params.n_clusters, n_features); @@ -107,7 +107,7 @@ template * #include * using namespace raft::cluster; * ... - * raft::raft::resources handle; + * raft::resources handle; * raft::cluster::KMeansParams params; * int n_features = 15, inertia, n_iter; * auto centroids = raft::make_device_matrix(handle, params.n_clusters, n_features); @@ -175,7 +175,7 @@ template * #include * using namespace raft::cluster; * ... - * raft::raft::resources handle; + * raft::resources handle; * raft::cluster::KMeansParams params; * int n_features = 15, inertia, n_iter; * auto centroids = raft::make_device_matrix(handle, params.n_clusters, n_features); diff --git a/cpp/include/raft/comms/std_comms.hpp b/cpp/include/raft/comms/std_comms.hpp index 667c8be285..8481360897 100644 --- a/cpp/include/raft/comms/std_comms.hpp +++ b/cpp/include/raft/comms/std_comms.hpp @@ -52,7 +52,7 @@ using std_comms = detail::std_comms; * #include * * ncclComm_t nccl_comm; - * raft::raft::resources handle; + * raft::resources handle; * * build_comms_nccl_only(&handle, nccl_comm, 5, 0); * ... @@ -98,7 +98,7 @@ void build_comms_nccl_only(resources* handle, ncclComm_t nccl_comm, int num_rank * #include * * ncclComm_t nccl_comm; - * raft::raft::resources handle; + * raft::resources handle; * ucp_worker_h ucp_worker; * ucp_ep_h *ucp_endpoints_arr; * diff --git a/cpp/include/raft/distance/distance-inl.cuh b/cpp/include/raft/distance/distance-inl.cuh index 13c9d57efd..d5f8d1cfe1 100644 --- a/cpp/include/raft/distance/distance-inl.cuh +++ b/cpp/include/raft/distance/distance-inl.cuh @@ -366,7 +366,7 @@ void pairwise_distance(raft::resources const& handle, * #include * #include * - * raft::raft::resources handle; + * raft::resources handle; * int n_samples = 5000; * int n_features = 50; * diff --git a/cpp/include/raft/neighbors/epsilon_neighborhood.cuh b/cpp/include/raft/neighbors/epsilon_neighborhood.cuh index bade4385fb..c2f531263d 100644 --- a/cpp/include/raft/neighbors/epsilon_neighborhood.cuh +++ b/cpp/include/raft/neighbors/epsilon_neighborhood.cuh @@ -76,7 +76,7 @@ void epsUnexpL2SqNeighborhood(bool* adj, * #include * #include * using namespace raft::neighbors; - * raft::raft::resources handle; + * raft::resources handle; * ... * auto adj = raft::make_device_matrix(handle, m * n); * auto vd = raft::make_device_vector(handle, m+1); @@ -120,4 +120,4 @@ void eps_neighbors_l2sq(raft::resources const& handle, } // namespace raft::neighbors::epsilon_neighborhood -#endif \ No newline at end of file +#endif From ace348f666ee6b2aac85df2ef4284d10207fb38f Mon Sep 17 00:00:00 2001 From: enp1s0 Date: Thu, 5 Dec 2024 22:52:56 +0900 Subject: [PATCH 2/2] Add `.view()` --- cpp/include/raft/cluster/kmeans.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/include/raft/cluster/kmeans.cuh b/cpp/include/raft/cluster/kmeans.cuh index fa5db93a64..ee1fc83a9b 100644 --- a/cpp/include/raft/cluster/kmeans.cuh +++ b/cpp/include/raft/cluster/kmeans.cuh @@ -61,7 +61,7 @@ using KeyValueIndexOp = detail::KeyValueIndexOp; * params, * X, * std::nullopt, - * centroids, + * centroids.view(), * raft::make_scalar_view(&inertia), * raft::make_scalar_view(&n_iter)); * @endcode