Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using raft::resources in rsvd #1543

Merged
merged 3 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Using raft::resources in rsvd
  • Loading branch information
cjnolet committed May 22, 2023
commit 9fe0ec72437070b564e0b52a27b9dabf90ec4406
7 changes: 4 additions & 3 deletions cpp/include/raft/linalg/detail/rsvd.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#pragma once

#include <raft/core/resource/cublas_handle.hpp>
#include <raft/core/resource/cuda_stream.hpp>
#include <raft/core/resource/cusolver_dn_handle.hpp>
#include <raft/linalg/eig.cuh>
#include <raft/linalg/gemm.cuh>
Expand All @@ -38,7 +39,7 @@ namespace linalg {
namespace detail {

template <typename math_t>
void randomized_svd(const raft::device_resources& handle,
void randomized_svd(const raft::resources& handle,
const math_t* in,
std::size_t n_rows,
std::size_t n_cols,
Expand All @@ -61,8 +62,8 @@ void randomized_svd(const raft::device_resources& handle,
#if CUDART_VERSION < 11050
RAFT_EXPECTS(gen_U && gen_V, "not computing U or V is not supported in CUDA version < 11.5");
#endif
cudaStream_t stream = handle.get_stream();
cusolverDnHandle_t cusolverH = handle.get_cusolver_dn_handle();
cudaStream_t stream = resource::get_cuda_stream(handle);
cusolverDnHandle_t cusolverH = resource::get_cusolver_dn_handle(handle);

char jobu = gen_U ? 'S' : 'N';
char jobv = gen_V ? 'S' : 'N';
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/raft/linalg/rsvd.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ void rsvd_perc_symmetric_jacobi(Args... args)
* @param[in] niters: Number of iteration of power method. (2 is recommended)
*/
template <typename math_t, typename idx_t>
void randomized_svd(const raft::device_resources& handle,
void randomized_svd(const raft::resources& handle,
raft::device_matrix_view<const math_t, idx_t, raft::col_major> in,
raft::device_vector_view<math_t, idx_t> S,
std::optional<raft::device_matrix_view<math_t, idx_t, raft::col_major>> U,
Expand Down Expand Up @@ -859,7 +859,7 @@ void randomized_svd(const raft::device_resources& handle,
* Please see above for documentation of `randomized_svd`.
*/
template <typename math_t, typename idx_t, typename opt_u_vec_t, typename opt_v_vec_t>
void randomized_svd(const raft::device_resources& handle,
void randomized_svd(const raft::resources& handle,
raft::device_matrix_view<const math_t, idx_t, raft::col_major> in,
raft::device_vector_view<math_t, idx_t> S,
opt_u_vec_t&& U,
Expand Down