Skip to content

Commit 3db77b3

Browse files
Remove a bunch of legacy code that's no longer used (#4609)
Supersedes #4553. That PR identified some issues with legacy code that's not really necessary anymore. This PR removes the `graph_utils.cuh` file and gets rid of a few straggling functions that still used it. Authors: - Chuck Hastings (https://github.com/ChuckHastings) Approvers: - Seunghwa Kang (https://github.com/seunghwak) - Robert Maynard (https://github.com/robertmaynard) URL: #4609
1 parent b8ae82e commit 3db77b3

File tree

11 files changed

+34
-527
lines changed

11 files changed

+34
-527
lines changed

cpp/src/community/egonet_impl.cuh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
// #define TIMING
1919

20-
#include "utilities/graph_utils.cuh"
21-
2220
#include <cugraph/algorithms.hpp>
2321
#include <cugraph/graph.hpp>
2422
#include <cugraph/graph_functions.hpp>

cpp/src/components/legacy/connectivity.cu

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
#include "scc_matrix.cuh"
18-
#include "utilities/graph_utils.cuh"
1918
#include "weak_cc.cuh"
2019

2120
#include <cugraph/algorithms.hpp>

cpp/src/layout/legacy/barnes_hut.cuh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "bh_kernels.cuh"
2020
#include "converters/legacy/COOtoCSR.cuh"
2121
#include "fa2_kernels.cuh"
22-
#include "utilities/graph_utils.cuh"
2322
#include "utils.hpp"
2423

2524
#include <cugraph/detail/utility_wrappers.hpp>

cpp/src/layout/legacy/fa2_kernels.cuh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
#pragma once
1818
#define restrict __restrict__
1919

20-
#include "utilities/graph_utils.cuh"
20+
// From old graph_utils.cuh
21+
#define CUDA_MAX_BLOCKS 65535
22+
#define CUDA_MAX_KERNEL_THREADS 256 // kernel will launch at most 256 threads per block
2123

2224
namespace cugraph {
2325
namespace detail {

cpp/src/sampling/random_walks.cuh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
//
1919
#pragma once
2020

21-
#include "utilities/graph_utils.cuh"
22-
2321
#include <cugraph/algorithms.hpp>
2422
#include <cugraph/detail/utility_wrappers.hpp>
2523
#include <cugraph/graph.hpp>

cpp/src/sampling/rw_traversals.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
//
1919
#pragma once
2020

21-
#include "utilities/graph_utils.cuh"
22-
2321
#include <cugraph/api_helpers.hpp>
2422
#include <cugraph/graph.hpp>
2523

cpp/src/structure/legacy/graph.cu

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "utilities/graph_utils.cuh"
18-
1917
#include <cugraph/legacy/graph.hpp>
2018
#include <cugraph/utilities/error.hpp>
2119

20+
#include <raft/core/device_span.hpp>
2221
#include <raft/util/device_atomics.cuh>
2322

2423
#include <rmm/exec_policy.hpp>
2524

25+
#include <thrust/execution_policy.h>
2626
#include <thrust/for_each.h>
2727
#include <thrust/iterator/counting_iterator.h>
28+
#include <thrust/sequence.h>
2829

2930
namespace {
3031

@@ -69,15 +70,40 @@ namespace legacy {
6970
template <typename VT, typename ET, typename WT>
7071
void GraphViewBase<VT, ET, WT>::get_vertex_identifiers(VT* identifiers) const
7172
{
72-
cugraph::detail::sequence<VT>(number_of_vertices, identifiers);
73+
thrust::sequence(thrust::device,
74+
thrust::device_pointer_cast(identifiers),
75+
thrust::device_pointer_cast(identifiers + number_of_vertices),
76+
VT{0});
77+
RAFT_CHECK_CUDA(nullptr);
7378
}
7479

80+
// FIXME: Need to get rid of this function... still used in python
7581
template <typename VT, typename ET, typename WT>
7682
void GraphCompressedSparseBaseView<VT, ET, WT>::get_source_indices(VT* src_indices) const
7783
{
7884
CUGRAPH_EXPECTS(offsets != nullptr, "No graph specified");
79-
cugraph::detail::offsets_to_indices<ET, VT>(
80-
offsets, GraphViewBase<VT, ET, WT>::number_of_vertices, src_indices);
85+
rmm::cuda_stream_view stream_view;
86+
87+
raft::device_span<VT> indices_span(src_indices, GraphViewBase<VT, ET, WT>::number_of_edges);
88+
89+
if (indices_span.size() > 0) {
90+
thrust::fill(rmm::exec_policy(stream_view), indices_span.begin(), indices_span.end(), VT{0});
91+
92+
thrust::for_each(rmm::exec_policy(stream_view),
93+
offsets + 1,
94+
offsets + GraphViewBase<VT, ET, WT>::number_of_vertices,
95+
[indices_span] __device__(ET offset) {
96+
if (offset < static_cast<ET>(indices_span.size())) {
97+
cuda::atomic_ref<VT, cuda::thread_scope_device> atomic_counter(
98+
indices_span.data()[offset]);
99+
atomic_counter.fetch_add(VT{1}, cuda::std::memory_order_relaxed);
100+
}
101+
});
102+
thrust::inclusive_scan(rmm::exec_policy(stream_view),
103+
indices_span.begin(),
104+
indices_span.end(),
105+
indices_span.begin());
106+
}
81107
}
82108

83109
template <typename VT, typename ET, typename WT>
@@ -152,6 +178,4 @@ void GraphCompressedSparseBaseView<VT, ET, WT>::degree(ET* degree, DegreeDirecti
152178
} // namespace legacy
153179
} // namespace cugraph
154180

155-
#include "utilities/eidir_graph_utils.hpp"
156-
157181
#include <cugraph/legacy/eidir_graph.hpp>

cpp/src/traversal/extract_bfs_paths_impl.cuh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include "detail/graph_partition_utils.cuh"
1919
#include "utilities/collect_comm.cuh"
20-
#include "utilities/graph_utils.cuh"
2120

2221
#include <cugraph/algorithms.hpp>
2322
#include <cugraph/detail/utility_wrappers.hpp>

cpp/src/utilities/eidecl_graph_utils.hpp

Lines changed: 0 additions & 40 deletions
This file was deleted.

cpp/src/utilities/eidir_graph_utils.hpp

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)