Skip to content

Commit b7dcaf3

Browse files
authored
Use appropriate edge src and dst properties based on is_multi_gpu flag (#4319)
Use appropriate edge src and dst properties based on is_multi_gpu flag Authors: - Naim (https://github.com/naimnv) Approvers: - Seunghwa Kang (https://github.com/seunghwak) - Chuck Hastings (https://github.com/ChuckHastings) URL: #4319
1 parent e5071d6 commit b7dcaf3

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

cpp/src/components/vertex_coloring_impl.cuh

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,32 @@ rmm::device_uvector<vertex_t> vertex_coloring(
8989

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

92-
cugraph::edge_src_property_t<graph_view_t, flag_t> src_mis_flags(handle, current_graph_view);
93-
cugraph::edge_dst_property_t<graph_view_t, flag_t> dst_mis_flags(handle, current_graph_view);
92+
cugraph::edge_src_property_t<graph_view_t, flag_t> src_mis_flags(handle);
93+
cugraph::edge_dst_property_t<graph_view_t, flag_t> dst_mis_flags(handle);
9494

95-
cugraph::update_edge_src_property(
96-
handle, current_graph_view, is_vertex_in_mis.begin(), src_mis_flags);
95+
if constexpr (graph_view_t::is_multi_gpu) {
96+
src_mis_flags =
97+
cugraph::edge_src_property_t<graph_view_t, flag_t>(handle, current_graph_view);
98+
dst_mis_flags =
99+
cugraph::edge_dst_property_t<graph_view_t, flag_t>(handle, current_graph_view);
97100

98-
cugraph::update_edge_dst_property(
99-
handle, current_graph_view, is_vertex_in_mis.begin(), dst_mis_flags);
101+
cugraph::update_edge_src_property(
102+
handle, current_graph_view, is_vertex_in_mis.begin(), src_mis_flags);
103+
104+
cugraph::update_edge_dst_property(
105+
handle, current_graph_view, is_vertex_in_mis.begin(), dst_mis_flags);
106+
}
100107

101108
if (color_id % 2 == 0) {
102109
cugraph::transform_e(
103110
handle,
104111
current_graph_view,
105-
src_mis_flags.view(),
106-
dst_mis_flags.view(),
112+
graph_view_t::is_multi_gpu
113+
? src_mis_flags.view()
114+
: detail::edge_major_property_view_t<vertex_t, flag_t const*>(is_vertex_in_mis.begin()),
115+
graph_view_t::is_multi_gpu ? dst_mis_flags.view()
116+
: detail::edge_minor_property_view_t<vertex_t, flag_t const*>(
117+
is_vertex_in_mis.begin(), vertex_t{0}),
107118
cugraph::edge_dummy_property_t{}.view(),
108119
[color_id] __device__(
109120
auto src, auto dst, auto is_src_in_mis, auto is_dst_in_mis, thrust::nullopt_t) {
@@ -118,8 +129,12 @@ rmm::device_uvector<vertex_t> vertex_coloring(
118129
cugraph::transform_e(
119130
handle,
120131
current_graph_view,
121-
src_mis_flags.view(),
122-
dst_mis_flags.view(),
132+
graph_view_t::is_multi_gpu
133+
? src_mis_flags.view()
134+
: detail::edge_major_property_view_t<vertex_t, flag_t const*>(is_vertex_in_mis.begin()),
135+
graph_view_t::is_multi_gpu ? dst_mis_flags.view()
136+
: detail::edge_minor_property_view_t<vertex_t, flag_t const*>(
137+
is_vertex_in_mis.begin(), vertex_t{0}),
123138
cugraph::edge_dummy_property_t{}.view(),
124139
[color_id] __device__(
125140
auto src, auto dst, auto is_src_in_mis, auto is_dst_in_mis, thrust::nullopt_t) {

0 commit comments

Comments
 (0)