Skip to content

Commit

Permalink
Fix Thrust 1.12 compile errors (#231)
Browse files Browse the repository at this point in the history
Initialize `rmm::exec_policy` with `rmm::cuda_stream_view` to fix Thrust 1.12 compile errors.

Authors:
  - Paul Taylor (https://github.com/trxcllnt)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #231
  • Loading branch information
trxcllnt authored May 18, 2021
1 parent 9ae2582 commit 6272ef1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cpp/include/raft/sparse/hierarchy/detail/agglomerative.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void extract_flattened_clusters(const raft::handle_t &handle, value_idx *labels,
size_t n_leaves) {
auto d_alloc = handle.get_device_allocator();
auto stream = handle.get_stream();
auto thrust_policy = rmm::exec_policy(stream);
auto thrust_policy = rmm::exec_policy(rmm::cuda_stream_view{stream});

// Handle special case where n_clusters == 1
if (n_clusters == 1) {
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/raft/sparse/hierarchy/detail/connectivities.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct distance_graph_impl<raft::hierarchy::LinkageDistance::KNN_GRAPH,
rmm::device_uvector<value_t> &data, int c) {
auto d_alloc = handle.get_device_allocator();
auto stream = handle.get_stream();
auto exec_policy = rmm::exec_policy(stream);
auto exec_policy = rmm::exec_policy(rmm::cuda_stream_view{stream});

// Need to symmetrize knn into undirected graph
raft::sparse::COO<value_t, value_idx> knn_graph_coo(d_alloc, stream);
Expand Down Expand Up @@ -133,4 +133,4 @@ void get_distance_graph(const raft::handle_t &handle, const value_t *X,

}; // namespace detail
}; // namespace hierarchy
}; // namespace raft
}; // namespace raft
10 changes: 5 additions & 5 deletions cpp/include/raft/sparse/mst/detail/mst_solver_inl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ MST_solver<vertex_t, edge_t, weight_t>::MST_solver(
sm_count = handle_.get_device_properties().multiProcessorCount;

//Initially, color holds the vertex id as color
auto policy = rmm::exec_policy(stream);
auto policy = rmm::exec_policy(rmm::cuda_stream_view{stream});
if (initialize_colors_) {
thrust::sequence(policy, color.begin(), color.end(), 0);
thrust::sequence(policy, color_index, color_index + v, 0);
Expand Down Expand Up @@ -212,7 +212,7 @@ struct alteration_functor {
// Compute the uper bound for the alteration
template <typename vertex_t, typename edge_t, typename weight_t>
weight_t MST_solver<vertex_t, edge_t, weight_t>::alteration_max() {
auto policy = rmm::exec_policy(stream);
auto policy = rmm::exec_policy(rmm::cuda_stream_view{stream});
rmm::device_vector<weight_t> tmp(e);
thrust::device_ptr<const weight_t> weights_ptr(weights);
thrust::copy(policy, weights_ptr, weights_ptr + e, tmp.begin());
Expand Down Expand Up @@ -308,7 +308,7 @@ void MST_solver<vertex_t, edge_t, weight_t>::label_prop(vertex_t* mst_src,
// Finds the minimum edge from each vertex to the lowest color
template <typename vertex_t, typename edge_t, typename weight_t>
void MST_solver<vertex_t, edge_t, weight_t>::min_edge_per_vertex() {
auto policy = rmm::exec_policy(stream);
auto policy = rmm::exec_policy(rmm::cuda_stream_view{stream});
thrust::fill(policy, min_edge_color.begin(), min_edge_color.end(),
std::numeric_limits<weight_t>::max());
thrust::fill(policy, new_mst_edge.begin(), new_mst_edge.end(),
Expand All @@ -333,7 +333,7 @@ void MST_solver<vertex_t, edge_t, weight_t>::min_edge_per_supervertex() {
auto nthreads = std::min(v, max_threads);
auto nblocks = std::min((v + nthreads - 1) / nthreads, max_blocks);

auto policy = rmm::exec_policy(stream);
auto policy = rmm::exec_policy(rmm::cuda_stream_view{stream});
thrust::fill(policy, temp_src.begin(), temp_src.end(),
std::numeric_limits<vertex_t>::max());

Expand Down Expand Up @@ -388,7 +388,7 @@ struct new_edges_functor {
template <typename vertex_t, typename edge_t, typename weight_t>
void MST_solver<vertex_t, edge_t, weight_t>::append_src_dst_pair(
vertex_t* mst_src, vertex_t* mst_dst, weight_t* mst_weights) {
auto policy = rmm::exec_policy(stream);
auto policy = rmm::exec_policy(rmm::cuda_stream_view{stream});

auto curr_mst_edge_count = prev_mst_edge_count[0];

Expand Down
2 changes: 1 addition & 1 deletion cpp/include/raft/sparse/op/reduce.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void max_duplicates(const raft::handle_t &handle,
auto d_alloc = handle.get_device_allocator();
auto stream = handle.get_stream();

auto exec_policy = rmm::exec_policy(stream);
auto exec_policy = rmm::exec_policy(rmm::cuda_stream_view{stream});

// compute diffs & take exclusive scan
rmm::device_uvector<value_idx> diff(nnz + 1, stream);
Expand Down

0 comments on commit 6272ef1

Please sign in to comment.