Skip to content

Commit

Permalink
Remove a bunch of legacy code that's no longer used (#4609)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ChuckHastings authored Aug 21, 2024
1 parent b8ae82e commit 3db77b3
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 527 deletions.
2 changes: 0 additions & 2 deletions cpp/src/community/egonet_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

// #define TIMING

#include "utilities/graph_utils.cuh"

#include <cugraph/algorithms.hpp>
#include <cugraph/graph.hpp>
#include <cugraph/graph_functions.hpp>
Expand Down
1 change: 0 additions & 1 deletion cpp/src/components/legacy/connectivity.cu
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

#include "scc_matrix.cuh"
#include "utilities/graph_utils.cuh"
#include "weak_cc.cuh"

#include <cugraph/algorithms.hpp>
Expand Down
1 change: 0 additions & 1 deletion cpp/src/layout/legacy/barnes_hut.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "bh_kernels.cuh"
#include "converters/legacy/COOtoCSR.cuh"
#include "fa2_kernels.cuh"
#include "utilities/graph_utils.cuh"
#include "utils.hpp"

#include <cugraph/detail/utility_wrappers.hpp>
Expand Down
4 changes: 3 additions & 1 deletion cpp/src/layout/legacy/fa2_kernels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#pragma once
#define restrict __restrict__

#include "utilities/graph_utils.cuh"
// From old graph_utils.cuh
#define CUDA_MAX_BLOCKS 65535
#define CUDA_MAX_KERNEL_THREADS 256 // kernel will launch at most 256 threads per block

namespace cugraph {
namespace detail {
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/sampling/random_walks.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
//
#pragma once

#include "utilities/graph_utils.cuh"

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
#include <cugraph/graph.hpp>
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/sampling/rw_traversals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
//
#pragma once

#include "utilities/graph_utils.cuh"

#include <cugraph/api_helpers.hpp>
#include <cugraph/graph.hpp>

Expand Down
38 changes: 31 additions & 7 deletions cpp/src/structure/legacy/graph.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@
* limitations under the License.
*/

#include "utilities/graph_utils.cuh"

#include <cugraph/legacy/graph.hpp>
#include <cugraph/utilities/error.hpp>

#include <raft/core/device_span.hpp>
#include <raft/util/device_atomics.cuh>

#include <rmm/exec_policy.hpp>

#include <thrust/execution_policy.h>
#include <thrust/for_each.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/sequence.h>

namespace {

Expand Down Expand Up @@ -69,15 +70,40 @@ namespace legacy {
template <typename VT, typename ET, typename WT>
void GraphViewBase<VT, ET, WT>::get_vertex_identifiers(VT* identifiers) const
{
cugraph::detail::sequence<VT>(number_of_vertices, identifiers);
thrust::sequence(thrust::device,
thrust::device_pointer_cast(identifiers),
thrust::device_pointer_cast(identifiers + number_of_vertices),
VT{0});
RAFT_CHECK_CUDA(nullptr);
}

// FIXME: Need to get rid of this function... still used in python
template <typename VT, typename ET, typename WT>
void GraphCompressedSparseBaseView<VT, ET, WT>::get_source_indices(VT* src_indices) const
{
CUGRAPH_EXPECTS(offsets != nullptr, "No graph specified");
cugraph::detail::offsets_to_indices<ET, VT>(
offsets, GraphViewBase<VT, ET, WT>::number_of_vertices, src_indices);
rmm::cuda_stream_view stream_view;

raft::device_span<VT> indices_span(src_indices, GraphViewBase<VT, ET, WT>::number_of_edges);

if (indices_span.size() > 0) {
thrust::fill(rmm::exec_policy(stream_view), indices_span.begin(), indices_span.end(), VT{0});

thrust::for_each(rmm::exec_policy(stream_view),
offsets + 1,
offsets + GraphViewBase<VT, ET, WT>::number_of_vertices,
[indices_span] __device__(ET offset) {
if (offset < static_cast<ET>(indices_span.size())) {
cuda::atomic_ref<VT, cuda::thread_scope_device> atomic_counter(
indices_span.data()[offset]);
atomic_counter.fetch_add(VT{1}, cuda::std::memory_order_relaxed);
}
});
thrust::inclusive_scan(rmm::exec_policy(stream_view),
indices_span.begin(),
indices_span.end(),
indices_span.begin());
}
}

template <typename VT, typename ET, typename WT>
Expand Down Expand Up @@ -152,6 +178,4 @@ void GraphCompressedSparseBaseView<VT, ET, WT>::degree(ET* degree, DegreeDirecti
} // namespace legacy
} // namespace cugraph

#include "utilities/eidir_graph_utils.hpp"

#include <cugraph/legacy/eidir_graph.hpp>
1 change: 0 additions & 1 deletion cpp/src/traversal/extract_bfs_paths_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include "detail/graph_partition_utils.cuh"
#include "utilities/collect_comm.cuh"
#include "utilities/graph_utils.cuh"

#include <cugraph/algorithms.hpp>
#include <cugraph/detail/utility_wrappers.hpp>
Expand Down
40 changes: 0 additions & 40 deletions cpp/src/utilities/eidecl_graph_utils.hpp

This file was deleted.

40 changes: 0 additions & 40 deletions cpp/src/utilities/eidir_graph_utils.hpp

This file was deleted.

Loading

0 comments on commit 3db77b3

Please sign in to comment.