From c38321734839617ce206b36b6c780ef3efb9beb1 Mon Sep 17 00:00:00 2001 From: Seunghwa Kang Date: Wed, 28 Sep 2022 18:18:33 -0700 Subject: [PATCH 1/3] fix warnings --- .../legacy/extract_subgraph_by_vertex.cu | 2 +- cpp/src/components/legacy/weak_cc.cuh | 2 +- cpp/src/linear_assignment/hungarian.cu | 6 ++-- ...v_transform_reduce_incoming_outgoing_e.cuh | 2 +- cpp/src/prims/property_op_utils.cuh | 2 +- cpp/src/sampling/random_walks.cu | 1 - cpp/src/sampling/random_walks.cuh | 3 +- cpp/src/sampling/rw_traversals.hpp | 2 +- cpp/src/serialization/serializer.cu | 2 -- cpp/src/structure/detail/structure_utils.cuh | 2 +- cpp/src/structure/graph_impl.cuh | 2 +- cpp/src/structure/legacy/graph.cu | 2 +- cpp/src/traversal/legacy/mg/common_utils.cuh | 2 +- cpp/src/tree/mst.cu | 18 +++++----- cpp/src/utilities/graph_utils.cuh | 2 +- cpp/tests/structure/streams.cu | 36 ++++++++++++------- 16 files changed, 48 insertions(+), 38 deletions(-) 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/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..334ee6f9587 100644 --- a/cpp/src/sampling/random_walks.cu +++ b/cpp/src/sampling/random_walks.cu @@ -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(); } } From bc19bd7389cef5370047470ecc120d75946638f3 Mon Sep 17 00:00:00 2001 From: Seunghwa Kang Date: Wed, 28 Sep 2022 18:21:57 -0700 Subject: [PATCH 2/3] copyright year --- cpp/src/sampling/random_walks.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/sampling/random_walks.cu b/cpp/src/sampling/random_walks.cu index 334ee6f9587..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. From 4bea386fc24726e3b0e8d1ceb9f8e317b2cce1a8 Mon Sep 17 00:00:00 2001 From: Seunghwa Kang Date: Wed, 28 Sep 2022 18:28:56 -0700 Subject: [PATCH 3/3] additional warning fixes --- cpp/src/generators/generator_tools.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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