diff --git a/cpp/src/community/legacy/extract_subgraph_by_vertex.cu b/cpp/src/community/legacy/extract_subgraph_by_vertex.cu index aad12b9563a..481b1fa33e9 100644 --- a/cpp/src/community/legacy/extract_subgraph_by_vertex.cu +++ b/cpp/src/community/legacy/extract_subgraph_by_vertex.cu @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/src/components/legacy/weak_cc.cuh b/cpp/src/components/legacy/weak_cc.cuh index e415ab28892..359b0a66079 100644 --- a/cpp/src/components/legacy/weak_cc.cuh +++ b/cpp/src/components/legacy/weak_cc.cuh @@ -27,7 +27,7 @@ #include #include -#include +#include #include "utils.h" #include diff --git a/cpp/src/generators/generator_tools.cu b/cpp/src/generators/generator_tools.cu index b9b7eb47675..ece07c43efd 100644 --- a/cpp/src/generators/generator_tools.cu +++ b/cpp/src/generators/generator_tools.cu @@ -18,7 +18,7 @@ #include #include -#include +#include #include diff --git a/cpp/src/linear_assignment/hungarian.cu b/cpp/src/linear_assignment/hungarian.cu index 563e0b04a7f..c25b4e25bca 100644 --- a/cpp/src/linear_assignment/hungarian.cu +++ b/cpp/src/linear_assignment/hungarian.cu @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -74,7 +74,7 @@ weight_t hungarian(raft::handle_t const& handle, rmm::device_uvector col_assignments_v(num_rows, handle.get_stream()); // Create an instance of LinearAssignmentProblem using problem size, number of subproblems - raft::lap::LinearAssignmentProblem lpx(handle, num_rows, 1, epsilon); + raft::solver::LinearAssignmentProblem lpx(handle, num_rows, 1, epsilon); // Solve LAP(s) for given cost matrix lpx.solve(d_original_cost, d_assignment, col_assignments_v.data()); @@ -109,7 +109,7 @@ weight_t hungarian(raft::handle_t const& handle, : max_cost; }); - raft::lap::LinearAssignmentProblem lpx(handle, n, 1, epsilon); + raft::solver::LinearAssignmentProblem lpx(handle, n, 1, epsilon); // Solve LAP(s) for given cost matrix lpx.solve(tmp_cost_v.begin(), tmp_row_assignment_v.begin(), tmp_col_assignment_v.begin()); diff --git a/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh b/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh index 4cc7bb02b5c..62582c97990 100644 --- a/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh +++ b/cpp/src/prims/per_v_transform_reduce_incoming_outgoing_e.cuh @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/src/prims/property_op_utils.cuh b/cpp/src/prims/property_op_utils.cuh index fa352f891cb..43f504dba2e 100644 --- a/cpp/src/prims/property_op_utils.cuh +++ b/cpp/src/prims/property_op_utils.cuh @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/src/sampling/random_walks.cu b/cpp/src/sampling/random_walks.cu index 8136e3b6185..b5f6b95ecb1 100644 --- a/cpp/src/sampling/random_walks.cu +++ b/cpp/src/sampling/random_walks.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ // Andrei Schaffer, aschaffer@nvidia.com // #include "random_walks.cuh" -#include namespace cugraph { // template explicit instantiation directives (EIDir's): diff --git a/cpp/src/sampling/random_walks.cuh b/cpp/src/sampling/random_walks.cuh index 26947e29d6b..506b1ab7385 100644 --- a/cpp/src/sampling/random_walks.cuh +++ b/cpp/src/sampling/random_walks.cuh @@ -18,13 +18,14 @@ // #pragma once +#include #include #include #include -#include #include +#include #include diff --git a/cpp/src/sampling/rw_traversals.hpp b/cpp/src/sampling/rw_traversals.hpp index ff90eb4c101..20c08f31249 100644 --- a/cpp/src/sampling/rw_traversals.hpp +++ b/cpp/src/sampling/rw_traversals.hpp @@ -27,8 +27,8 @@ #include -#include #include +#include #include diff --git a/cpp/src/serialization/serializer.cu b/cpp/src/serialization/serializer.cu index c8150af0ab4..cac0bbbaabf 100644 --- a/cpp/src/serialization/serializer.cu +++ b/cpp/src/serialization/serializer.cu @@ -21,8 +21,6 @@ #include -#include - #include #include diff --git a/cpp/src/structure/detail/structure_utils.cuh b/cpp/src/structure/detail/structure_utils.cuh index c92c32ee6fa..7947032de21 100644 --- a/cpp/src/structure/detail/structure_utils.cuh +++ b/cpp/src/structure/detail/structure_utils.cuh @@ -20,8 +20,8 @@ #include #include -#include #include +#include #include #include diff --git a/cpp/src/structure/graph_impl.cuh b/cpp/src/structure/graph_impl.cuh index 0084a190806..8e18784d7b8 100644 --- a/cpp/src/structure/graph_impl.cuh +++ b/cpp/src/structure/graph_impl.cuh @@ -28,8 +28,8 @@ #include #include -#include #include +#include #include #include diff --git a/cpp/src/structure/legacy/graph.cu b/cpp/src/structure/legacy/graph.cu index 5ee2982b9b3..1766ae3bed3 100644 --- a/cpp/src/structure/legacy/graph.cu +++ b/cpp/src/structure/legacy/graph.cu @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/src/traversal/legacy/mg/common_utils.cuh b/cpp/src/traversal/legacy/mg/common_utils.cuh index 195dbbe0440..b6adbf2c728 100644 --- a/cpp/src/traversal/legacy/mg/common_utils.cuh +++ b/cpp/src/traversal/legacy/mg/common_utils.cuh @@ -34,7 +34,7 @@ #include #include -#include +#include namespace cugraph { diff --git a/cpp/src/tree/mst.cu b/cpp/src/tree/mst.cu index 44c3c9ffe72..aff51806693 100644 --- a/cpp/src/tree/mst.cu +++ b/cpp/src/tree/mst.cu @@ -25,7 +25,7 @@ #include #include -#include +#include namespace cugraph { @@ -40,14 +40,14 @@ std::unique_ptr> mst_impl( { auto stream = handle.get_stream(); rmm::device_uvector colors(graph.number_of_vertices, stream); - auto mst_edges = raft::mst::mst(handle, - graph.offsets, - graph.indices, - graph.edge_data, - graph.number_of_vertices, - graph.number_of_edges, - colors.data(), - stream); + auto mst_edges = raft::sparse::solver::mst(handle, + graph.offsets, + graph.indices, + graph.edge_data, + graph.number_of_vertices, + graph.number_of_edges, + colors.data(), + stream); legacy::GraphCOOContents coo_contents{ graph.number_of_vertices, diff --git a/cpp/src/utilities/graph_utils.cuh b/cpp/src/utilities/graph_utils.cuh index af6ba093591..827bca0248f 100644 --- a/cpp/src/utilities/graph_utils.cuh +++ b/cpp/src/utilities/graph_utils.cuh @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/tests/structure/streams.cu b/cpp/tests/structure/streams.cu index 17c3dda1e4d..b8275ab3392 100644 --- a/cpp/tests/structure/streams.cu +++ b/cpp/tests/structure/streams.cu @@ -22,25 +22,37 @@ #include #include #include + struct StreamTest : public ::testing::Test { }; + TEST_F(StreamTest, basic_test) { - int n_streams = 4; + size_t n_streams = 4; auto stream_pool = std::make_shared(n_streams); raft::handle_t handle(rmm::cuda_stream_per_thread, stream_pool); - const size_t intput_size = 4096; + const size_t input_size = 4096; + + std::vector threads(n_streams); + + for (size_t i = 0; i < n_streams; ++i) { + threads[i] = std::thread( + [&handle, input_size](size_t i) { + rmm::device_uvector u(input_size, handle.get_next_usable_stream(i)); + rmm::device_uvector v(input_size, handle.get_next_usable_stream(i)); + thrust::transform(rmm::exec_policy(handle.get_next_usable_stream(i)), + u.begin(), + u.end(), + v.begin(), + v.begin(), + 2 * thrust::placeholders::_1 + thrust::placeholders::_2); + CUDA_TRY(cudaStreamSynchronize(handle.get_next_usable_stream(i))); + }, + i); + } -#pragma omp parallel for - for (int i = 0; i < n_streams; i++) { - rmm::device_uvector u(intput_size, handle.get_next_usable_stream(i)), - v(intput_size, handle.get_next_usable_stream(i)); - thrust::transform(rmm::exec_policy(handle.get_next_usable_stream(i)), - u.begin(), - u.end(), - v.begin(), - v.begin(), - 2 * thrust::placeholders::_1 + thrust::placeholders::_2); + for (size_t i = 0; i < n_streams; ++i) { + threads[i].join(); } }