diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 24713376dd5..1825e141744 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -183,8 +183,8 @@ set(CUGRAPH_SOURCES src/traversal/legacy/bfs.cu src/link_prediction/jaccard.cu src/link_prediction/overlap.cu - src/layout/force_atlas2.cu - src/converters/COOtoCSR.cu + src/layout/legacy/force_atlas2.cu + src/converters/legacy/COOtoCSR.cu src/community/legacy/spectral_clustering.cu src/community/louvain_sg.cu src/community/louvain_mg.cu @@ -206,7 +206,7 @@ set(CUGRAPH_SOURCES src/cores/core_number_sg.cu src/cores/core_number_mg.cu src/traversal/two_hop_neighbors.cu - src/components/connectivity.cu + src/components/legacy/connectivity.cu src/centrality/betweenness_centrality.cu src/generators/generate_rmat_edgelist.cu src/generators/generator_tools.cu diff --git a/cpp/include/cugraph/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp index 1b8c112bb2c..4085282f770 100644 --- a/cpp/include/cugraph/algorithms.hpp +++ b/cpp/include/cugraph/algorithms.hpp @@ -21,8 +21,8 @@ #include #include -#include #include +#include #ifndef NO_CUGRAPH_OPS #include diff --git a/cpp/include/cugraph/eidir_graph.hpp b/cpp/include/cugraph/eidir_graph.hpp deleted file mode 100644 index b1acaaf5cce..00000000000 --- a/cpp/include/cugraph/eidir_graph.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma once - -namespace cugraph { - -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; - -} // namespace cugraph diff --git a/cpp/include/cugraph/functions.hpp b/cpp/include/cugraph/legacy/functions.hpp similarity index 97% rename from cpp/include/cugraph/functions.hpp rename to cpp/include/cugraph/legacy/functions.hpp index 23edd204c3b..875c92df24d 100644 --- a/cpp/include/cugraph/functions.hpp +++ b/cpp/include/cugraph/legacy/functions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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. @@ -64,4 +64,5 @@ void comms_bcast(const raft::handle_t& handle, value_t* value, size_t count) { handle.get_comms().bcast(value, count, 0, handle.get_stream()); } + } // namespace cugraph diff --git a/cpp/include/cugraph/internals.hpp b/cpp/include/cugraph/legacy/internals.hpp similarity index 96% rename from cpp/include/cugraph/internals.hpp rename to cpp/include/cugraph/legacy/internals.hpp index 1c311304ae4..f59c40b6076 100644 --- a/cpp/include/cugraph/internals.hpp +++ b/cpp/include/cugraph/legacy/internals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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. diff --git a/cpp/src/community/legacy/ecg.cu b/cpp/src/community/legacy/ecg.cu index da519158890..78c3412f16a 100644 --- a/cpp/src/community/legacy/ecg.cu +++ b/cpp/src/community/legacy/ecg.cu @@ -15,7 +15,6 @@ */ #include -#include #include #include #include diff --git a/cpp/src/community/legacy/louvain.cu b/cpp/src/community/legacy/louvain.cu index 17ae62d9ddf..b1d67a0d9db 100644 --- a/cpp/src/community/legacy/louvain.cu +++ b/cpp/src/community/legacy/louvain.cu @@ -122,5 +122,3 @@ template std::pair louvain(raft::handle_t const&, size_t, double); } // namespace cugraph - -#include diff --git a/cpp/src/community/legacy/louvain.cuh b/cpp/src/community/legacy/louvain.cuh index 375e65bf87b..fc2f1ede1aa 100644 --- a/cpp/src/community/legacy/louvain.cuh +++ b/cpp/src/community/legacy/louvain.cuh @@ -17,7 +17,7 @@ #include -#include +#include #include #include diff --git a/cpp/src/components/connectivity.cu b/cpp/src/components/legacy/connectivity.cu similarity index 100% rename from cpp/src/components/connectivity.cu rename to cpp/src/components/legacy/connectivity.cu diff --git a/cpp/src/components/scc_matrix.cuh b/cpp/src/components/legacy/scc_matrix.cuh similarity index 100% rename from cpp/src/components/scc_matrix.cuh rename to cpp/src/components/legacy/scc_matrix.cuh diff --git a/cpp/src/components/utils.h b/cpp/src/components/legacy/utils.h similarity index 100% rename from cpp/src/components/utils.h rename to cpp/src/components/legacy/utils.h diff --git a/cpp/src/components/weak_cc.cuh b/cpp/src/components/legacy/weak_cc.cuh similarity index 100% rename from cpp/src/components/weak_cc.cuh rename to cpp/src/components/legacy/weak_cc.cuh diff --git a/cpp/src/converters/COOtoCSR.cu b/cpp/src/converters/legacy/COOtoCSR.cu similarity index 97% rename from cpp/src/converters/COOtoCSR.cu rename to cpp/src/converters/legacy/COOtoCSR.cu index 904b2856c49..5e8e1604586 100644 --- a/cpp/src/converters/COOtoCSR.cu +++ b/cpp/src/converters/legacy/COOtoCSR.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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. @@ -15,7 +15,6 @@ */ #include "COOtoCSR.cuh" -#include namespace cugraph { diff --git a/cpp/src/converters/COOtoCSR.cuh b/cpp/src/converters/legacy/COOtoCSR.cuh similarity index 99% rename from cpp/src/converters/COOtoCSR.cuh rename to cpp/src/converters/legacy/COOtoCSR.cuh index bd9a165f90d..09f3d131b8e 100644 --- a/cpp/src/converters/COOtoCSR.cuh +++ b/cpp/src/converters/legacy/COOtoCSR.cuh @@ -41,7 +41,7 @@ #include #include -#include +#include #include diff --git a/cpp/src/converters/permute_graph.cuh b/cpp/src/converters/permute_graph.cuh deleted file mode 100644 index 01a8f219f4e..00000000000 --- a/cpp/src/converters/permute_graph.cuh +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2019-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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "converters/COOtoCSR.cuh" -#include -#include -#include -#include -#include - -#include -#include - -namespace cugraph { -namespace detail { - -template -struct permutation_functor { - IdxT const* permutation; - permutation_functor(IdxT const* p) : permutation(p) {} - __host__ __device__ IdxT operator()(IdxT in) const { return permutation[in]; } -}; - -/** - * This function takes a graph and a permutation vector and permutes the - * graph according to the permutation vector. So each vertex id i becomes - * vertex id permutation[i] in the permuted graph. - * - * @param graph The graph to permute. - * @param permutation The permutation vector to use, must be a valid permutation - * i.e. contains all values 0-n exactly once. - * @param result View of the resulting graph... note this should be pre allocated - * and number_of_vertices and number_of_edges should be set - * @return The permuted graph. - */ -template -void permute_graph(legacy::GraphCSRView const& graph, - vertex_t const* permutation, - legacy::GraphCSRView result, - cudaStream_t stream = 0) -{ - // Create a COO out of the CSR - rmm::device_vector src_vertices_v(graph.number_of_edges); - rmm::device_vector dst_vertices_v(graph.number_of_edges); - rmm::device_vector weights_v(graph.number_of_edges); - - vertex_t* d_src = src_vertices_v.data().get(); - vertex_t* d_dst = dst_vertices_v.data().get(); - weight_t* d_weights = weights_v.data().get(); - - graph.get_source_indices(d_src); - - if (graph.has_data()) - thrust::copy(rmm::exec_policy(stream), - graph.edge_data, - graph.edge_data + graph.number_of_edges, - d_weights); - - // Permute the src_indices - permutation_functor pf(permutation); - thrust::transform(rmm::exec_policy(stream), d_src, d_src + graph.number_of_edges, d_src, pf); - - // Permute the destination indices - thrust::transform( - rmm::exec_policy(stream), graph.indices, graph.indices + graph.number_of_edges, d_dst, pf); - - legacy::GraphCOOView graph_coo; - - graph_coo.number_of_vertices = graph.number_of_vertices; - graph_coo.number_of_edges = graph.number_of_edges; - graph_coo.src_indices = d_src; - graph_coo.dst_indices = d_dst; - - if (graph.has_data()) { - graph_coo.edge_data = d_weights; - } else { - graph_coo.edge_data = nullptr; - } - - cugraph::coo_to_csr_inplace(graph_coo, result); -} - -} // namespace detail -} // namespace cugraph diff --git a/cpp/src/layout/barnes_hut.cuh b/cpp/src/layout/legacy/barnes_hut.cuh similarity index 99% rename from cpp/src/layout/barnes_hut.cuh rename to cpp/src/layout/legacy/barnes_hut.cuh index bd191bd9772..4018466cfda 100644 --- a/cpp/src/layout/barnes_hut.cuh +++ b/cpp/src/layout/legacy/barnes_hut.cuh @@ -20,12 +20,12 @@ #include "fa2_kernels.cuh" #include "utils.hpp" -#include +#include #include #include -#include #include +#include #include #include diff --git a/cpp/src/layout/bh_kernels.cuh b/cpp/src/layout/legacy/bh_kernels.cuh similarity index 99% rename from cpp/src/layout/bh_kernels.cuh rename to cpp/src/layout/legacy/bh_kernels.cuh index 8dbc08a6440..5b101363314 100644 --- a/cpp/src/layout/bh_kernels.cuh +++ b/cpp/src/layout/legacy/bh_kernels.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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. diff --git a/cpp/src/layout/exact_fa2.cuh b/cpp/src/layout/legacy/exact_fa2.cuh similarity index 98% rename from cpp/src/layout/exact_fa2.cuh rename to cpp/src/layout/legacy/exact_fa2.cuh index b30a5993370..e9125c84105 100644 --- a/cpp/src/layout/exact_fa2.cuh +++ b/cpp/src/layout/legacy/exact_fa2.cuh @@ -19,11 +19,11 @@ #include #include -#include +#include #include -#include #include +#include #include #include diff --git a/cpp/src/layout/exact_repulsion.cuh b/cpp/src/layout/legacy/exact_repulsion.cuh similarity index 100% rename from cpp/src/layout/exact_repulsion.cuh rename to cpp/src/layout/legacy/exact_repulsion.cuh diff --git a/cpp/src/layout/fa2_kernels.cuh b/cpp/src/layout/legacy/fa2_kernels.cuh similarity index 100% rename from cpp/src/layout/fa2_kernels.cuh rename to cpp/src/layout/legacy/fa2_kernels.cuh diff --git a/cpp/src/layout/force_atlas2.cu b/cpp/src/layout/legacy/force_atlas2.cu similarity index 99% rename from cpp/src/layout/force_atlas2.cu rename to cpp/src/layout/legacy/force_atlas2.cu index 9dc4ee286b0..d23642b8ae4 100644 --- a/cpp/src/layout/force_atlas2.cu +++ b/cpp/src/layout/legacy/force_atlas2.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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. diff --git a/cpp/src/layout/utils.hpp b/cpp/src/layout/legacy/utils.hpp similarity index 100% rename from cpp/src/layout/utils.hpp rename to cpp/src/layout/legacy/utils.hpp diff --git a/cpp/tests/components/con_comp_test.cu b/cpp/tests/components/con_comp_test.cu index 9cbb8e63775..e65ead2ca24 100644 --- a/cpp/tests/components/con_comp_test.cu +++ b/cpp/tests/components/con_comp_test.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. * * NVIDIA CORPORATION and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation @@ -20,7 +20,7 @@ #include -#include +#include #include #include diff --git a/cpp/tests/components/scc_test.cu b/cpp/tests/components/scc_test.cu index 400464053f4..7418ecc6601 100644 --- a/cpp/tests/components/scc_test.cu +++ b/cpp/tests/components/scc_test.cu @@ -18,8 +18,8 @@ #include -#include -#include +#include +#include #include #include #include diff --git a/cpp/tests/tree/mst_test.cu b/cpp/tests/tree/mst_test.cu index 4afb1ad6b69..75122e20451 100644 --- a/cpp/tests/tree/mst_test.cu +++ b/cpp/tests/tree/mst_test.cu @@ -31,7 +31,7 @@ #include -#include "../src/converters/COOtoCSR.cuh" +#include "../src/converters/legacy/COOtoCSR.cuh" #include #include #include diff --git a/cpp/tests/utilities/matrix_market_file_utilities.cu b/cpp/tests/utilities/matrix_market_file_utilities.cu index ae546973bf7..0d17412f09a 100644 --- a/cpp/tests/utilities/matrix_market_file_utilities.cu +++ b/cpp/tests/utilities/matrix_market_file_utilities.cu @@ -17,8 +17,8 @@ #include #include -#include #include +#include #include #include diff --git a/cpp/tests/utilities/test_graphs.hpp b/cpp/tests/utilities/test_graphs.hpp index cb34253b3fa..88c7c61f963 100644 --- a/cpp/tests/utilities/test_graphs.hpp +++ b/cpp/tests/utilities/test_graphs.hpp @@ -17,9 +17,9 @@ #include #include -#include // legacy coo_to_csr #include #include +#include // legacy coo_to_csr #include #include diff --git a/python/cugraph/cugraph/internals/callbacks_implems.hpp b/python/cugraph/cugraph/internals/callbacks_implems.hpp index 79fab937965..10a8fc7503a 100644 --- a/python/cugraph/cugraph/internals/callbacks_implems.hpp +++ b/python/cugraph/cugraph/internals/callbacks_implems.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-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,7 @@ #pragma once #include -#include +#include #include diff --git a/python/cugraph/cugraph/layout/force_atlas2.pxd b/python/cugraph/cugraph/layout/force_atlas2.pxd index 5496d1b655e..3112faf6d96 100644 --- a/python/cugraph/cugraph/layout/force_atlas2.pxd +++ b/python/cugraph/cugraph/layout/force_atlas2.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-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. # You may obtain a copy of the License at @@ -19,7 +19,7 @@ from cugraph.structure.graph_primtypes cimport * from libcpp cimport bool -cdef extern from "cugraph/internals.hpp" namespace "cugraph::internals": +cdef extern from "cugraph/legacy/internals.hpp" namespace "cugraph::internals": cdef cppclass GraphBasedDimRedCallback cdef extern from "cugraph/algorithms.hpp" namespace "cugraph": diff --git a/python/cugraph/cugraph/layout/force_atlas2_wrapper.pyx b/python/cugraph/cugraph/layout/force_atlas2_wrapper.pyx index 1644875f034..73de7415971 100644 --- a/python/cugraph/cugraph/layout/force_atlas2_wrapper.pyx +++ b/python/cugraph/cugraph/layout/force_atlas2_wrapper.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-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. # You may obtain a copy of the License at @@ -25,7 +25,7 @@ import cudf from numba import cuda import numpy as np -cdef extern from "cugraph/internals.hpp" namespace "cugraph::internals": +cdef extern from "cugraph/legacy/internals.hpp" namespace "cugraph::internals": cdef cppclass GraphBasedDimRedCallback diff --git a/python/cugraph/cugraph/structure/utils.pxd b/python/cugraph/cugraph/structure/utils.pxd index 350b5890149..687109215bd 100644 --- a/python/cugraph/cugraph/structure/utils.pxd +++ b/python/cugraph/cugraph/structure/utils.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2021, NVIDIA CORPORATION. +# Copyright (c) 2019-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. # You may obtain a copy of the License at @@ -20,7 +20,7 @@ from cugraph.structure.graph_primtypes cimport * from libcpp.memory cimport unique_ptr -cdef extern from "cugraph/functions.hpp" namespace "cugraph": +cdef extern from "cugraph/legacy/functions.hpp" namespace "cugraph": cdef unique_ptr[GraphCSR[VT,ET,WT]] coo_to_csr[VT,ET,WT]( const GraphCOOView[VT,ET,WT] &graph) except +