From cbae3155c0ee9d10a26f4eb0724419602e0b198d Mon Sep 17 00:00:00 2001 From: divyegala Date: Thu, 30 Jan 2025 22:59:53 +0000 Subject: [PATCH] working through updates for cuvs --- cpp/include/raft/linalg/detail/lanczos.cuh | 16 ++++---- .../sparse/neighbors/detail/knn_graph.cuh | 2 +- .../raft/spectral/detail/matrix_wrappers.hpp | 40 +++++++++---------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/cpp/include/raft/linalg/detail/lanczos.cuh b/cpp/include/raft/linalg/detail/lanczos.cuh index d4d3325f77..33b9faa27d 100644 --- a/cpp/include/raft/linalg/detail/lanczos.cuh +++ b/cpp/include/raft/linalg/detail/lanczos.cuh @@ -745,10 +745,10 @@ static int lanczosRestart(raft::resources const& handle, * @param seed random seed. * @return error flag. */ -template +template int computeSmallestEigenvectors( raft::resources const& handle, - spectral::matrix::sparse_matrix_t const* A, + spectral::matrix::sparse_matrix_t const* A, index_type_t nEigVecs, index_type_t maxIter, index_type_t restartIter, @@ -986,10 +986,10 @@ int computeSmallestEigenvectors( return 0; } -template +template int computeSmallestEigenvectors( raft::resources const& handle, - spectral::matrix::sparse_matrix_t const& A, + spectral::matrix::sparse_matrix_t const& A, index_type_t nEigVecs, index_type_t maxIter, index_type_t restartIter, @@ -1090,10 +1090,10 @@ int computeSmallestEigenvectors( * @param seed random seed. * @return error flag. */ -template +template int computeLargestEigenvectors( raft::resources const& handle, - spectral::matrix::sparse_matrix_t const* A, + spectral::matrix::sparse_matrix_t const* A, index_type_t nEigVecs, index_type_t maxIter, index_type_t restartIter, @@ -1334,10 +1334,10 @@ int computeLargestEigenvectors( return 0; } -template +template int computeLargestEigenvectors( raft::resources const& handle, - spectral::matrix::sparse_matrix_t const& A, + spectral::matrix::sparse_matrix_t const& A, index_type_t nEigVecs, index_type_t maxIter, index_type_t restartIter, diff --git a/cpp/include/raft/sparse/neighbors/detail/knn_graph.cuh b/cpp/include/raft/sparse/neighbors/detail/knn_graph.cuh index 435875f813..88391a8935 100644 --- a/cpp/include/raft/sparse/neighbors/detail/knn_graph.cuh +++ b/cpp/include/raft/sparse/neighbors/detail/knn_graph.cuh @@ -142,7 +142,7 @@ void knn_graph(raft::resources const& handle, conv_indices(int64_indices.data(), indices.data(), nnz, stream); raft::sparse::linalg::symmetrize( - handle, rows.data(), indices.data(), data.data(), (value_idx)m, (value_idx)k, (nnz_t)nnz, out); + handle, rows.data(), indices.data(), data.data(), m, k, nnz, out); } }; // namespace raft::sparse::neighbors::detail diff --git a/cpp/include/raft/spectral/detail/matrix_wrappers.hpp b/cpp/include/raft/spectral/detail/matrix_wrappers.hpp index 81abac7312..f7aa507059 100644 --- a/cpp/include/raft/spectral/detail/matrix_wrappers.hpp +++ b/cpp/include/raft/spectral/detail/matrix_wrappers.hpp @@ -314,15 +314,15 @@ struct sparse_matrix_t { nnz_type const nnz_; }; -template -struct laplacian_matrix_t : sparse_matrix_t { +template +struct laplacian_matrix_t : sparse_matrix_t { laplacian_matrix_t(resources const& raft_handle, index_type const* row_offsets, index_type const* col_indices, value_type const* values, index_type const nrows, - index_type const nnz) - : sparse_matrix_t( + nnz_type const nnz) + : sparse_matrix_t( raft_handle, row_offsets, col_indices, values, nrows, nnz), diagonal_(raft_handle, nrows) { @@ -332,8 +332,8 @@ struct laplacian_matrix_t : sparse_matrix_t { } laplacian_matrix_t(resources const& raft_handle, - sparse_matrix_t const& csr_m) - : sparse_matrix_t(raft_handle, + sparse_matrix_t const& csr_m) + : sparse_matrix_t(raft_handle, csr_m.row_offsets_, csr_m.col_indices_, csr_m.values_, @@ -343,7 +343,7 @@ struct laplacian_matrix_t : sparse_matrix_t { { vector_t ones{raft_handle, (size_t)csr_m.nrows_}; ones.fill(1.0); - sparse_matrix_t::mv(1, ones.raw(), 0, diagonal_.raw()); + sparse_matrix_t::mv(1, ones.raw(), 0, diagonal_.raw()); } // y = alpha*A*x + beta*y @@ -357,9 +357,9 @@ struct laplacian_matrix_t : sparse_matrix_t { bool symmetric = false) const override { constexpr int BLOCK_SIZE = 1024; - auto n = sparse_matrix_t::nrows_; + auto n = sparse_matrix_t::nrows_; - auto handle = sparse_matrix_t::get_handle(); + auto handle = sparse_matrix_t::get_handle(); auto cublas_h = resource::get_cublas_handle(handle); auto stream = resource::get_cuda_stream(handle); @@ -382,31 +382,31 @@ struct laplacian_matrix_t : sparse_matrix_t { // Apply adjacency matrix // - sparse_matrix_t::mv(-alpha, x, 1, y, alg, transpose, symmetric); + sparse_matrix_t::mv(-alpha, x, 1, y, alg, transpose, symmetric); } vector_t diagonal_; }; -template -struct modularity_matrix_t : laplacian_matrix_t { +template +struct modularity_matrix_t : laplacian_matrix_t { modularity_matrix_t(resources const& raft_handle, index_type const* row_offsets, index_type const* col_indices, value_type const* values, index_type const nrows, - index_type const nnz) - : laplacian_matrix_t( + nnz_type const nnz) + : laplacian_matrix_t( raft_handle, row_offsets, col_indices, values, nrows, nnz) { - edge_sum_ = laplacian_matrix_t::diagonal_.nrm1(); + edge_sum_ = laplacian_matrix_t::diagonal_.nrm1(); } modularity_matrix_t(resources const& raft_handle, sparse_matrix_t const& csr_m) - : laplacian_matrix_t(raft_handle, csr_m) + : laplacian_matrix_t(raft_handle, csr_m) { - edge_sum_ = laplacian_matrix_t::diagonal_.nrm1(); + edge_sum_ = laplacian_matrix_t::diagonal_.nrm1(); } // y = alpha*A*x + beta*y @@ -427,7 +427,7 @@ struct modularity_matrix_t : laplacian_matrix_t { // y = A*x // - sparse_matrix_t::mv(alpha, x, 0, y, alg, transpose, symmetric); + sparse_matrix_t::mv(alpha, x, 0, y, alg, transpose, symmetric); value_type dot_res; // gamma = d'*x @@ -437,7 +437,7 @@ struct modularity_matrix_t : laplacian_matrix_t { RAFT_CUBLAS_TRY( raft::linalg::detail::cublasdot(cublas_h, n, - laplacian_matrix_t::diagonal_.raw(), + laplacian_matrix_t::diagonal_.raw(), 1, x, 1, @@ -452,7 +452,7 @@ struct modularity_matrix_t : laplacian_matrix_t { raft::linalg::detail::cublasaxpy(cublas_h, n, &gamma_, - laplacian_matrix_t::diagonal_.raw(), + laplacian_matrix_t::diagonal_.raw(), 1, y, 1,