Skip to content

Use appropriate edge src and dst properties based on is_multi_gpu flag #4319

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

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions cpp/src/components/vertex_coloring_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,32 @@ rmm::device_uvector<vertex_t> vertex_coloring(

if (current_graph_view.compute_number_of_edges(handle) == 0) { break; }

cugraph::edge_src_property_t<graph_view_t, flag_t> src_mis_flags(handle, current_graph_view);
cugraph::edge_dst_property_t<graph_view_t, flag_t> dst_mis_flags(handle, current_graph_view);
cugraph::edge_src_property_t<graph_view_t, flag_t> src_mis_flags(handle);
cugraph::edge_dst_property_t<graph_view_t, flag_t> dst_mis_flags(handle);

cugraph::update_edge_src_property(
handle, current_graph_view, is_vertex_in_mis.begin(), src_mis_flags);
if constexpr (graph_view_t::is_multi_gpu) {
src_mis_flags =
cugraph::edge_src_property_t<graph_view_t, flag_t>(handle, current_graph_view);
dst_mis_flags =
cugraph::edge_dst_property_t<graph_view_t, flag_t>(handle, current_graph_view);

cugraph::update_edge_dst_property(
handle, current_graph_view, is_vertex_in_mis.begin(), dst_mis_flags);
cugraph::update_edge_src_property(
handle, current_graph_view, is_vertex_in_mis.begin(), src_mis_flags);

cugraph::update_edge_dst_property(
handle, current_graph_view, is_vertex_in_mis.begin(), dst_mis_flags);
}

if (color_id % 2 == 0) {
cugraph::transform_e(
handle,
current_graph_view,
src_mis_flags.view(),
dst_mis_flags.view(),
graph_view_t::is_multi_gpu
? src_mis_flags.view()
: detail::edge_major_property_view_t<vertex_t, flag_t const*>(is_vertex_in_mis.begin()),
graph_view_t::is_multi_gpu ? dst_mis_flags.view()
: detail::edge_minor_property_view_t<vertex_t, flag_t const*>(
is_vertex_in_mis.begin(), vertex_t{0}),
cugraph::edge_dummy_property_t{}.view(),
[color_id] __device__(
auto src, auto dst, auto is_src_in_mis, auto is_dst_in_mis, thrust::nullopt_t) {
Expand All @@ -118,8 +129,12 @@ rmm::device_uvector<vertex_t> vertex_coloring(
cugraph::transform_e(
handle,
current_graph_view,
src_mis_flags.view(),
dst_mis_flags.view(),
graph_view_t::is_multi_gpu
? src_mis_flags.view()
: detail::edge_major_property_view_t<vertex_t, flag_t const*>(is_vertex_in_mis.begin()),
graph_view_t::is_multi_gpu ? dst_mis_flags.view()
: detail::edge_minor_property_view_t<vertex_t, flag_t const*>(
is_vertex_in_mis.begin(), vertex_t{0}),
cugraph::edge_dummy_property_t{}.view(),
[color_id] __device__(
auto src, auto dst, auto is_src_in_mis, auto is_dst_in_mis, thrust::nullopt_t) {
Expand Down