Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a bunch of legacy code that's no longer used #4609

Merged
merged 8 commits into from
Aug 21, 2024
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
Loading