diff --git a/cpp/include/cugraph/detail/decompress_edge_partition.cuh b/cpp/include/cugraph/detail/decompress_edge_partition.cuh index 6b974a326dd..c94f456f215 100644 --- a/cpp/include/cugraph/detail/decompress_edge_partition.cuh +++ b/cpp/include/cugraph/detail/decompress_edge_partition.cuh @@ -209,7 +209,11 @@ void decompress_edge_partition_to_fill_edgelist_majors( } } -template +template void decompress_edge_partition_to_edgelist( raft::handle_t const& handle, edge_partition_device_view_t edge_partition, @@ -217,12 +221,15 @@ void decompress_edge_partition_to_edgelist( edge_partition_weight_view, std::optional> edge_partition_id_view, + std::optional> + edge_partition_type_view, std::optional> edge_partition_mask_view, raft::device_span edgelist_majors /* [OUT] */, raft::device_span edgelist_minors /* [OUT] */, std::optional> edgelist_weights /* [OUT] */, std::optional> edgelist_ids /* [OUT] */, + std::optional> edgelist_types /* [OUT] */, std::optional> const& segment_offsets) { auto number_of_edges = edge_partition.number_of_edges(); @@ -271,6 +278,22 @@ void decompress_edge_partition_to_edgelist( (*edgelist_ids).begin()); } } + + if (edge_partition_type_view) { + assert(edgelist_types.has_value()); + if (edge_partition_mask_view) { + copy_if_mask_set(handle, + (*edge_partition_type_view).value_first(), + (*edge_partition_type_view).value_first() + number_of_edges, + (*edge_partition_mask_view).value_first(), + (*edgelist_types).begin()); + } else { + thrust::copy(handle.get_thrust_policy(), + (*edge_partition_type_view).value_first(), + (*edge_partition_type_view).value_first() + number_of_edges, + (*edgelist_types).begin()); + } + } } } // namespace detail diff --git a/cpp/include/cugraph/graph_functions.hpp b/cpp/include/cugraph/graph_functions.hpp index 6d4470e8251..79ff576571e 100644 --- a/cpp/include/cugraph/graph_functions.hpp +++ b/cpp/include/cugraph/graph_functions.hpp @@ -344,6 +344,7 @@ void renumber_local_ext_vertices(raft::handle_t const& handle, * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type. * @tparam edge_t Type of edge identifiers. Needs to be an integral type. * @tparam weight_t Type of edge weights. Needs to be a floating point type. + * @tparam edge_type_t Type of edge types. Needs to be an integral type. * @tparam store_transposed Flag indicating whether to use sources (if false) or destinations (if * true) as major indices in storing edges using a 2D sparse matrix. transposed. * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false) @@ -351,8 +352,9 @@ void renumber_local_ext_vertices(raft::handle_t const& handle, * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and * handles to various CUDA libraries) to run graph algorithms. * @param graph_view Graph view object of the graph to be decompressed. - * @param edge_id_view Optional view object holding edge ids for @p graph_view. * @param edge_weight_view Optional view object holding edge weights for @p graph_view. + * @param edge_id_view Optional view object holding edge ids for @p graph_view. + * @param edge_type_view Optional view object holding edge types for @p graph_view. * @param renumber_map If valid, return the renumbered edge list based on the provided @p * renumber_map * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`). @@ -363,17 +365,20 @@ void renumber_local_ext_vertices(raft::handle_t const& handle, template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> + std::optional>, + std::optional>> decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check = false); diff --git a/cpp/src/c_api/betweenness_centrality.cpp b/cpp/src/c_api/betweenness_centrality.cpp index 577826fe097..a3f7252891c 100644 --- a/cpp/src/c_api/betweenness_centrality.cpp +++ b/cpp/src/c_api/betweenness_centrality.cpp @@ -234,12 +234,13 @@ struct edge_betweenness_centrality_functor : public cugraph::c_api::abstract_fun normalized_, do_expensive_check_); - auto [src_ids, dst_ids, output_centralities, output_edge_ids] = - cugraph::decompress_to_edgelist( + auto [src_ids, dst_ids, output_centralities, output_edge_ids, output_edge_types] = + cugraph::decompress_to_edgelist( handle_, graph_view, std::make_optional(centralities.view()), (edge_ids != nullptr) ? std::make_optional(edge_ids->view()) : std::nullopt, + std::nullopt, (number_map != nullptr) ? std::make_optional(raft::device_span{ number_map->data(), number_map->size()}) : std::nullopt); diff --git a/cpp/src/community/k_truss_impl.cuh b/cpp/src/community/k_truss_impl.cuh index 3db9fd70de2..7f96312703d 100644 --- a/cpp/src/community/k_truss_impl.cuh +++ b/cpp/src/community/k_truss_impl.cuh @@ -671,12 +671,14 @@ k_truss(raft::handle_t const& handle, edge_weight_view = edge_weight ? std::make_optional((*edge_weight).view()) : std::optional>{std::nullopt}; - std::tie(edgelist_srcs, edgelist_dsts, edgelist_wgts, std::ignore) = decompress_to_edgelist( - handle, - cur_graph_view, - edge_weight_view, - std::optional>{std::nullopt}, - std::optional>(std::nullopt)); + std::tie(edgelist_srcs, edgelist_dsts, edgelist_wgts, std::ignore, std::ignore) = + decompress_to_edgelist( + handle, + cur_graph_view, + edge_weight_view, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + std::optional>(std::nullopt)); auto num_triangles = edge_triangle_count( handle, @@ -894,12 +896,14 @@ k_truss(raft::handle_t const& handle, num_triangles.resize(num_edges_with_triangles, handle.get_stream()); } - std::tie(edgelist_srcs, edgelist_dsts, edgelist_wgts, std::ignore) = decompress_to_edgelist( - handle, - cur_graph_view, - edge_weight_view ? std::make_optional(*edge_weight_view) : std::nullopt, - std::optional>{std::nullopt}, - std::optional>(std::nullopt)); + std::tie(edgelist_srcs, edgelist_dsts, edgelist_wgts, std::ignore, std::ignore) = + decompress_to_edgelist( + handle, + cur_graph_view, + edge_weight_view ? std::make_optional(*edge_weight_view) : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + std::optional>(std::nullopt)); std::tie(edgelist_srcs, edgelist_dsts, edgelist_wgts) = symmetrize_edgelist(handle, diff --git a/cpp/src/prims/transform_reduce_dst_nbr_intersection_of_e_endpoints_by_v.cuh b/cpp/src/prims/transform_reduce_dst_nbr_intersection_of_e_endpoints_by_v.cuh index 244586e6d9e..c938b10fbbb 100644 --- a/cpp/src/prims/transform_reduce_dst_nbr_intersection_of_e_endpoints_by_v.cuh +++ b/cpp/src/prims/transform_reduce_dst_nbr_intersection_of_e_endpoints_by_v.cuh @@ -309,16 +309,19 @@ void transform_reduce_dst_nbr_intersection_of_e_endpoints_by_v( detail::decompress_edge_partition_to_edgelist( handle, edge_partition, std::nullopt, std::nullopt, + std::nullopt, edge_partition_e_mask, raft::device_span(majors.data(), majors.size()), raft::device_span(minors.data(), minors.size()), std::nullopt, std::nullopt, + std::nullopt, segment_offsets); auto vertex_pair_first = diff --git a/cpp/src/structure/coarsen_graph_impl.cuh b/cpp/src/structure/coarsen_graph_impl.cuh index f83cd752285..0689dc4a53a 100644 --- a/cpp/src/structure/coarsen_graph_impl.cuh +++ b/cpp/src/structure/coarsen_graph_impl.cuh @@ -171,11 +171,12 @@ decompress_edge_partition_to_relabeled_and_grouped_and_coarsened_edgelist( ? std::make_optional>( edgelist_majors.size(), handle.get_stream()) : std::nullopt; - detail::decompress_edge_partition_to_edgelist( + detail::decompress_edge_partition_to_edgelist( handle, edge_partition, edge_partition_weight_view, std::nullopt, + std::nullopt, edge_partition_e_mask, raft::device_span(edgelist_majors.data(), edgelist_majors.size()), raft::device_span(edgelist_minors.data(), edgelist_minors.size()), @@ -183,6 +184,7 @@ decompress_edge_partition_to_relabeled_and_grouped_and_coarsened_edgelist( (*edgelist_weights).size()) : std::nullopt, std::nullopt, + std::nullopt, segment_offsets); auto pair_first = diff --git a/cpp/src/structure/decompress_to_edgelist_impl.cuh b/cpp/src/structure/decompress_to_edgelist_impl.cuh index 55230c0a05a..d94040493e2 100644 --- a/cpp/src/structure/decompress_to_edgelist_impl.cuh +++ b/cpp/src/structure/decompress_to_edgelist_impl.cuh @@ -49,18 +49,21 @@ namespace { template std::enable_if_t, rmm::device_uvector, std::optional>, - std::optional>>> + std::optional>, + std::optional>>> decompress_to_edgelist_impl( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check) { @@ -99,10 +102,13 @@ decompress_to_edgelist_impl( auto edgelist_weights = edge_weight_view ? std::make_optional>( edgelist_majors.size(), handle.get_stream()) : std::nullopt; + auto edgelist_types = edge_type_view ? std::make_optional>( + edgelist_majors.size(), handle.get_stream()) + : std::nullopt; size_t cur_size{0}; for (size_t i = 0; i < edgelist_edge_counts.size(); ++i) { - detail::decompress_edge_partition_to_edgelist( + detail::decompress_edge_partition_to_edgelist( handle, edge_partition_device_view_t( graph_view.local_edge_partition_view(i)), @@ -115,6 +121,11 @@ decompress_to_edgelist_impl( detail::edge_partition_edge_property_device_view_t>( (*edge_id_view), i) : std::nullopt, + edge_type_view + ? std::make_optional< + detail::edge_partition_edge_property_device_view_t>( + (*edge_type_view), i) + : std::nullopt, graph_view.has_edge_mask() ? std::make_optional< detail::edge_partition_edge_property_device_view_t>( @@ -128,6 +139,9 @@ decompress_to_edgelist_impl( edgelist_ids ? std::make_optional>( (*edgelist_ids).data() + cur_size, edgelist_edge_counts[i]) : std::nullopt, + edgelist_types ? std::make_optional>( + (*edgelist_types).data() + cur_size, edgelist_edge_counts[i]) + : std::nullopt, graph_view.local_edge_partition_segment_offsets(i)); cur_size += edgelist_edge_counts[i]; } @@ -153,36 +167,95 @@ decompress_to_edgelist_impl( for (size_t i = 0; i < graph_view.number_of_local_edge_partitions(); ++i) { major_ptrs[i] = edgelist_majors.data() + cur_size; minor_ptrs[i] = edgelist_minors.data() + cur_size; + if (edgelist_weights) { if (edgelist_ids) { - thrust::sort_by_key( - handle.get_thrust_policy(), - minor_ptrs[i], - minor_ptrs[i] + edgelist_edge_counts[i], - thrust::make_zip_iterator(thrust::make_tuple(major_ptrs[i], - (*edgelist_ids).data() + cur_size, - (*edgelist_weights).data() + cur_size))); + if (edgelist_types) { + auto zip_itr = + thrust::make_zip_iterator(thrust::make_tuple(major_ptrs[i], + (*edgelist_weights).data() + cur_size, + (*edgelist_ids).data() + cur_size, + (*edgelist_types).data() + cur_size)); + + thrust::sort_by_key(handle.get_thrust_policy(), + minor_ptrs[i], + minor_ptrs[i] + edgelist_edge_counts[i], + zip_itr); + + } else { + auto zip_itr = + thrust::make_zip_iterator(thrust::make_tuple(major_ptrs[i], + (*edgelist_weights).data() + cur_size, + (*edgelist_ids).data() + cur_size)); + + thrust::sort_by_key(handle.get_thrust_policy(), + minor_ptrs[i], + minor_ptrs[i] + edgelist_edge_counts[i], + zip_itr); + } } else { - thrust::sort_by_key(handle.get_thrust_policy(), - minor_ptrs[i], - minor_ptrs[i] + edgelist_edge_counts[i], - thrust::make_zip_iterator(thrust::make_tuple( - major_ptrs[i], (*edgelist_weights).data() + cur_size))); + if (edgelist_types) { + auto zip_itr = + thrust::make_zip_iterator(thrust::make_tuple(major_ptrs[i], + (*edgelist_weights).data() + cur_size, + (*edgelist_types).data() + cur_size)); + + thrust::sort_by_key(handle.get_thrust_policy(), + minor_ptrs[i], + minor_ptrs[i] + edgelist_edge_counts[i], + zip_itr); + + } else { + auto zip_itr = thrust::make_zip_iterator( + thrust::make_tuple(major_ptrs[i], (*edgelist_weights).data() + cur_size)); + + thrust::sort_by_key(handle.get_thrust_policy(), + minor_ptrs[i], + minor_ptrs[i] + edgelist_edge_counts[i], + zip_itr); + } } } else { if (edgelist_ids) { - thrust::sort_by_key(handle.get_thrust_policy(), - minor_ptrs[i], - minor_ptrs[i] + edgelist_edge_counts[i], - thrust::make_zip_iterator(thrust::make_tuple( - major_ptrs[i], (*edgelist_ids).data() + cur_size))); + if (edgelist_types) { + auto zip_itr = + thrust::make_zip_iterator(thrust::make_tuple(major_ptrs[i], + (*edgelist_ids).data() + cur_size, + (*edgelist_types).data() + cur_size)); + + thrust::sort_by_key(handle.get_thrust_policy(), + minor_ptrs[i], + minor_ptrs[i] + edgelist_edge_counts[i], + zip_itr); + + } else { + auto zip_itr = thrust::make_zip_iterator( + thrust::make_tuple(major_ptrs[i], (*edgelist_ids).data() + cur_size)); + + thrust::sort_by_key(handle.get_thrust_policy(), + minor_ptrs[i], + minor_ptrs[i] + edgelist_edge_counts[i], + zip_itr); + } } else { - thrust::sort_by_key(handle.get_thrust_policy(), - minor_ptrs[i], - minor_ptrs[i] + edgelist_edge_counts[i], - major_ptrs[i]); + if (edgelist_types) { + auto zip_itr = thrust::make_zip_iterator( + thrust::make_tuple(major_ptrs[i], (*edgelist_types).data() + cur_size)); + + thrust::sort_by_key(handle.get_thrust_policy(), + minor_ptrs[i], + minor_ptrs[i] + edgelist_edge_counts[i], + zip_itr); + + } else { + thrust::sort_by_key(handle.get_thrust_policy(), + minor_ptrs[i], + minor_ptrs[i] + edgelist_edge_counts[i], + major_ptrs[i]); + } } } + rmm::device_uvector d_segment_offsets(d_thresholds.size(), handle.get_stream()); thrust::lower_bound(handle.get_thrust_policy(), minor_ptrs[i], @@ -214,24 +287,28 @@ decompress_to_edgelist_impl( return std::make_tuple(store_transposed ? std::move(edgelist_minors) : std::move(edgelist_majors), store_transposed ? std::move(edgelist_majors) : std::move(edgelist_minors), std::move(edgelist_weights), - std::move(edgelist_ids)); + std::move(edgelist_ids), + std::move(edgelist_types)); } template std::enable_if_t, rmm::device_uvector, std::optional>, - std::optional>>> + std::optional>, + std::optional>>> decompress_to_edgelist_impl( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check) { @@ -258,7 +335,12 @@ decompress_to_edgelist_impl( auto edgelist_ids = edge_id_view ? std::make_optional>( edgelist_majors.size(), handle.get_stream()) : std::nullopt; - detail::decompress_edge_partition_to_edgelist( + + auto edgelist_types = edge_type_view ? std::make_optional>( + edgelist_majors.size(), handle.get_stream()) + : std::nullopt; + + detail::decompress_edge_partition_to_edgelist( handle, edge_partition_device_view_t( graph_view.local_edge_partition_view()), @@ -271,6 +353,11 @@ decompress_to_edgelist_impl( detail::edge_partition_edge_property_device_view_t>( (*edge_id_view), 0) : std::nullopt, + edge_type_view + ? std::make_optional< + detail::edge_partition_edge_property_device_view_t>( + (*edge_type_view), 0) + : std::nullopt, graph_view.has_edge_mask() ? std::make_optional< detail::edge_partition_edge_property_device_view_t>( @@ -284,6 +371,10 @@ decompress_to_edgelist_impl( edgelist_ids ? std::make_optional>((*edgelist_ids).data(), (*edgelist_ids).size()) : std::nullopt, + edgelist_types ? std::make_optional>((*edgelist_types).data(), + (*edgelist_types).size()) + : std::nullopt, + graph_view.local_edge_partition_segment_offsets()); if (renumber_map) { @@ -299,7 +390,8 @@ decompress_to_edgelist_impl( return std::make_tuple(store_transposed ? std::move(edgelist_minors) : std::move(edgelist_majors), store_transposed ? std::move(edgelist_majors) : std::move(edgelist_minors), std::move(edgelist_weights), - std::move(edgelist_ids)); + std::move(edgelist_ids), + std::move(edgelist_types)); } } // namespace @@ -307,22 +399,35 @@ decompress_to_edgelist_impl( template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> + std::optional>, + std::optional>> decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check) { - return decompress_to_edgelist_impl( - handle, graph_view, edge_weight_view, edge_id_view, renumber_map, do_expensive_check); + return decompress_to_edgelist_impl(handle, + graph_view, + edge_weight_view, + edge_id_view, + edge_type_view, + renumber_map, + do_expensive_check); } } // namespace cugraph diff --git a/cpp/src/structure/decompress_to_edgelist_mg.cu b/cpp/src/structure/decompress_to_edgelist_mg.cu index 8321477d0a0..f8177d0417d 100644 --- a/cpp/src/structure/decompress_to_edgelist_mg.cu +++ b/cpp/src/structure/decompress_to_edgelist_mg.cu @@ -22,144 +22,168 @@ namespace cugraph { template std::tuple, rmm::device_uvector, std::optional>, + std::optional>, std::optional>> -decompress_to_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, + std::optional>, std::optional>> -decompress_to_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, + std::optional>, std::optional>> -decompress_to_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, + std::optional>, std::optional>> -decompress_to_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); diff --git a/cpp/src/structure/decompress_to_edgelist_sg.cu b/cpp/src/structure/decompress_to_edgelist_sg.cu index 09f42750f50..f2c1e07fde6 100644 --- a/cpp/src/structure/decompress_to_edgelist_sg.cu +++ b/cpp/src/structure/decompress_to_edgelist_sg.cu @@ -22,144 +22,168 @@ namespace cugraph { template std::tuple, rmm::device_uvector, std::optional>, + std::optional>, std::optional>> -decompress_to_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, + std::optional>, std::optional>> -decompress_to_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, + std::optional>, std::optional>> -decompress_to_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, + std::optional>, std::optional>> -decompress_to_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, - std::optional>> -decompress_to_edgelist( + std::optional>, + std::optional>> +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, + std::optional> edge_type_view, std::optional> renumber_map, bool do_expensive_check); diff --git a/cpp/src/structure/symmetrize_graph_impl.cuh b/cpp/src/structure/symmetrize_graph_impl.cuh index baddc5f1da1..ae8f2b0a608 100644 --- a/cpp/src/structure/symmetrize_graph_impl.cuh +++ b/cpp/src/structure/symmetrize_graph_impl.cuh @@ -78,15 +78,17 @@ symmetrize_graph_impl( rmm::device_uvector edgelist_dsts(0, handle.get_stream()); std::optional> edgelist_weights{std::nullopt}; - std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore) = decompress_to_edgelist( - handle, - graph_view, - edge_weights - ? std::optional>{(*edge_weights).view()} - : std::nullopt, - std::optional>{std::nullopt}, - std::make_optional>((*renumber_map).data(), - (*renumber_map).size())); + std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore, std::ignore) = + decompress_to_edgelist( + handle, + graph_view, + edge_weights + ? std::optional>{(*edge_weights).view()} + : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + std::make_optional>((*renumber_map).data(), + (*renumber_map).size())); graph = graph_t(handle); std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights) = @@ -168,16 +170,18 @@ symmetrize_graph_impl( rmm::device_uvector edgelist_dsts(0, handle.get_stream()); std::optional> edgelist_weights{std::nullopt}; - std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore) = decompress_to_edgelist( - handle, - graph_view, - edge_weights - ? std::optional>{(*edge_weights).view()} - : std::nullopt, - std::optional>{std::nullopt}, - renumber_map ? std::make_optional>((*renumber_map).data(), - (*renumber_map).size()) - : std::nullopt); + std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore, std::ignore) = + decompress_to_edgelist( + handle, + graph_view, + edge_weights + ? std::optional>{(*edge_weights).view()} + : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + renumber_map ? std::make_optional>((*renumber_map).data(), + (*renumber_map).size()) + : std::nullopt); graph = graph_t(handle); std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights) = diff --git a/cpp/src/structure/transpose_graph_impl.cuh b/cpp/src/structure/transpose_graph_impl.cuh index 710d222ad61..a1eef536c43 100644 --- a/cpp/src/structure/transpose_graph_impl.cuh +++ b/cpp/src/structure/transpose_graph_impl.cuh @@ -79,15 +79,17 @@ transpose_graph_impl( rmm::device_uvector edgelist_dsts(0, handle.get_stream()); std::optional> edgelist_weights{std::nullopt}; - std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore) = decompress_to_edgelist( - handle, - graph_view, - edge_weights - ? std::optional>{(*edge_weights).view()} - : std::nullopt, - std::optional>{std::nullopt}, - std::make_optional>((*renumber_map).data(), - (*renumber_map).size())); + std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore, std::ignore) = + decompress_to_edgelist( + handle, + graph_view, + edge_weights + ? std::optional>{(*edge_weights).view()} + : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + std::make_optional>((*renumber_map).data(), + (*renumber_map).size())); graph = graph_t(handle); std::tie(store_transposed ? edgelist_srcs : edgelist_dsts, @@ -175,16 +177,18 @@ transpose_graph_impl( rmm::device_uvector edgelist_dsts(0, handle.get_stream()); std::optional> edgelist_weights{std::nullopt}; - std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore) = decompress_to_edgelist( - handle, - graph_view, - edge_weights - ? std::optional>{(*edge_weights).view()} - : std::nullopt, - std::optional>{std::nullopt}, - renumber_map ? std::make_optional>((*renumber_map).data(), - (*renumber_map).size()) - : std::nullopt); + std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore, std::ignore) = + decompress_to_edgelist( + handle, + graph_view, + edge_weights + ? std::optional>{(*edge_weights).view()} + : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + renumber_map ? std::make_optional>((*renumber_map).data(), + (*renumber_map).size()) + : std::nullopt); graph = graph_t(handle); auto vertices = renumber ? std::move(renumber_map) : std::make_optional>(number_of_vertices, diff --git a/cpp/src/structure/transpose_graph_storage_impl.cuh b/cpp/src/structure/transpose_graph_storage_impl.cuh index 53285b47d3a..f8e479f28ff 100644 --- a/cpp/src/structure/transpose_graph_storage_impl.cuh +++ b/cpp/src/structure/transpose_graph_storage_impl.cuh @@ -79,15 +79,17 @@ transpose_graph_storage_impl( rmm::device_uvector edgelist_dsts(0, handle.get_stream()); std::optional> edgelist_weights{std::nullopt}; - std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore) = decompress_to_edgelist( - handle, - graph_view, - edge_weights - ? std::optional>{(*edge_weights).view()} - : std::nullopt, - std::optional>{std::nullopt}, - std::make_optional>((*renumber_map).data(), - (*renumber_map).size())); + std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore, std::ignore) = + decompress_to_edgelist( + handle, + graph_view, + edge_weights + ? std::optional>{(*edge_weights).view()} + : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + std::make_optional>((*renumber_map).data(), + (*renumber_map).size())); graph = graph_t(handle); std::tie(!store_transposed ? edgelist_dsts : edgelist_srcs, @@ -180,16 +182,18 @@ transpose_graph_storage_impl( rmm::device_uvector edgelist_dsts(0, handle.get_stream()); std::optional> edgelist_weights{std::nullopt}; - std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore) = decompress_to_edgelist( - handle, - graph_view, - edge_weights - ? std::optional>{(*edge_weights).view()} - : std::nullopt, - std::optional>{std::nullopt}, - renumber_map ? std::make_optional>((*renumber_map).data(), - (*renumber_map).size()) - : std::nullopt); + std::tie(edgelist_srcs, edgelist_dsts, edgelist_weights, std::ignore, std::ignore) = + decompress_to_edgelist( + handle, + graph_view, + edge_weights + ? std::optional>{(*edge_weights).view()} + : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + renumber_map ? std::make_optional>((*renumber_map).data(), + (*renumber_map).size()) + : std::nullopt); graph = graph_t(handle); auto vertices = renumber ? std::move(renumber_map) : std::make_optional>(number_of_vertices, diff --git a/cpp/tests/centrality/eigenvector_centrality_test.cpp b/cpp/tests/centrality/eigenvector_centrality_test.cpp index c80c762d382..ab87cccd0e3 100644 --- a/cpp/tests/centrality/eigenvector_centrality_test.cpp +++ b/cpp/tests/centrality/eigenvector_centrality_test.cpp @@ -181,11 +181,12 @@ class Tests_EigenvectorCentrality rmm::device_uvector src_v(0, handle.get_stream()); std::optional> opt_wgt_v{std::nullopt}; - std::tie(dst_v, src_v, opt_wgt_v, std::ignore) = cugraph::decompress_to_edgelist( + std::tie(dst_v, src_v, opt_wgt_v, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph_view, edge_weight_view, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, std::optional>{std::nullopt}); auto h_src = cugraph::test::to_host(handle, src_v); diff --git a/cpp/tests/community/egonet_validate.cu b/cpp/tests/community/egonet_validate.cu index 9830deb8e1b..541baee2be9 100644 --- a/cpp/tests/community/egonet_validate.cu +++ b/cpp/tests/community/egonet_validate.cu @@ -48,12 +48,14 @@ egonet_reference( rmm::device_uvector d_coo_dst(0, handle.get_stream()); std::optional> d_coo_wgt{std::nullopt}; - std::tie(d_coo_src, d_coo_dst, d_coo_wgt, std::ignore) = cugraph::decompress_to_edgelist( - handle, - graph_view, - edge_weight_view, - std::optional>{std::nullopt}, - std::optional>{std::nullopt}); + std::tie(d_coo_src, d_coo_dst, d_coo_wgt, std::ignore, std::ignore) = + cugraph::decompress_to_edgelist( + handle, + graph_view, + edge_weight_view, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}); #else // FIXME: This should be faster (smaller list of edges to operate on), but uniform_nbr_sample // doesn't preserve multi-edges (which is probably a bug) diff --git a/cpp/tests/cores/k_core_validate.cu b/cpp/tests/cores/k_core_validate.cu index b264ed53540..53c97dd466b 100644 --- a/cpp/tests/cores/k_core_validate.cu +++ b/cpp/tests/cores/k_core_validate.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,13 +65,15 @@ void check_correctness( rmm::device_uvector graph_dst(0, handle.get_stream()); std::optional> graph_wgt{std::nullopt}; - std::tie(graph_src, graph_dst, graph_wgt, std::ignore) = cugraph::decompress_to_edgelist( - handle, - graph_view, - edge_weight_view, - std::optional>{std::nullopt}, - std::optional>{std::nullopt}, - false); + std::tie(graph_src, graph_dst, graph_wgt, std::ignore, std::ignore) = + cugraph::decompress_to_edgelist( + handle, + graph_view, + edge_weight_view, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + false); // Now we'll count how many edges should be in the subgraph auto expected_edge_count = diff --git a/cpp/tests/prims/mg_transform_e.cu b/cpp/tests/prims/mg_transform_e.cu index 92046bdd8f8..2b8d5d52905 100644 --- a/cpp/tests/prims/mg_transform_e.cu +++ b/cpp/tests/prims/mg_transform_e.cu @@ -127,11 +127,12 @@ class Tests_MGTransformE if (prims_usecase.use_edgelist) { rmm::device_uvector srcs(0, handle_->get_stream()); rmm::device_uvector dsts(0, handle_->get_stream()); - std::tie(srcs, dsts, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( + std::tie(srcs, dsts, std::ignore, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( *handle_, mg_graph_view, std::optional>{std::nullopt}, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, std::optional>{std::nullopt}); auto edge_first = thrust::make_zip_iterator( thrust::make_tuple(store_transposed ? dsts.begin() : srcs.begin(), diff --git a/cpp/tests/sampling/random_walks_check.cuh b/cpp/tests/sampling/random_walks_check.cuh index 399bf991785..0fd73b5bba7 100644 --- a/cpp/tests/sampling/random_walks_check.cuh +++ b/cpp/tests/sampling/random_walks_check.cuh @@ -40,11 +40,12 @@ void random_walks_validate( rmm::device_uvector d_dst(0, handle.get_stream()); std::optional> d_wgt{std::nullopt}; - std::tie(d_src, d_dst, d_wgt, std::ignore) = cugraph::decompress_to_edgelist( + std::tie(d_src, d_dst, d_wgt, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph_view, edge_weight_view, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, std::optional>{std::nullopt}); if constexpr (multi_gpu) { diff --git a/cpp/tests/structure/mg_symmetrize_test.cpp b/cpp/tests/structure/mg_symmetrize_test.cpp index 7eb387f3915..e607370f62a 100644 --- a/cpp/tests/structure/mg_symmetrize_test.cpp +++ b/cpp/tests/structure/mg_symmetrize_test.cpp @@ -128,14 +128,16 @@ class Tests_MGSymmetrize rmm::device_uvector d_mg_dsts(0, handle_->get_stream()); std::optional> d_mg_weights{std::nullopt}; - std::tie(d_mg_srcs, d_mg_dsts, d_mg_weights, std::ignore) = cugraph::decompress_to_edgelist( - *handle_, - mg_graph.view(), - mg_edge_weights ? std::make_optional((*mg_edge_weights).view()) : std::nullopt, - std::optional>{std::nullopt}, - mg_renumber_map ? std::make_optional>( - (*mg_renumber_map).data(), (*mg_renumber_map).size()) - : std::nullopt); + std::tie(d_mg_srcs, d_mg_dsts, d_mg_weights, std::ignore, std::ignore) = + cugraph::decompress_to_edgelist( + *handle_, + mg_graph.view(), + mg_edge_weights ? std::make_optional((*mg_edge_weights).view()) : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + mg_renumber_map ? std::make_optional>( + (*mg_renumber_map).data(), (*mg_renumber_map).size()) + : std::nullopt); // 4-2. aggregate MG results @@ -166,12 +168,14 @@ class Tests_MGSymmetrize rmm::device_uvector d_sg_dsts(0, handle_->get_stream()); std::optional> d_sg_weights{std::nullopt}; - std::tie(d_sg_srcs, d_sg_dsts, d_sg_weights, std::ignore) = cugraph::decompress_to_edgelist( - *handle_, - sg_graph.view(), - sg_edge_weights ? std::make_optional((*sg_edge_weights).view()) : std::nullopt, - std::optional>{std::nullopt}, - std::optional>{std::nullopt}); + std::tie(d_sg_srcs, d_sg_dsts, d_sg_weights, std::ignore, std::ignore) = + cugraph::decompress_to_edgelist( + *handle_, + sg_graph.view(), + sg_edge_weights ? std::make_optional((*sg_edge_weights).view()) : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}); // 4-5. compare diff --git a/cpp/tests/structure/mg_transpose_storage_test.cpp b/cpp/tests/structure/mg_transpose_storage_test.cpp index 4cbbe500dd8..c8b4f70f1e2 100644 --- a/cpp/tests/structure/mg_transpose_storage_test.cpp +++ b/cpp/tests/structure/mg_transpose_storage_test.cpp @@ -136,16 +136,18 @@ class Tests_MGTransposeStorage rmm::device_uvector d_mg_dsts(0, handle_->get_stream()); std::optional> d_mg_weights{std::nullopt}; - std::tie(d_mg_srcs, d_mg_dsts, d_mg_weights, std::ignore) = cugraph::decompress_to_edgelist( - *handle_, - mg_storage_transposed_graph.view(), - mg_storage_transposed_edge_weights - ? std::make_optional((*mg_storage_transposed_edge_weights).view()) - : std::nullopt, - std::optional>{std::nullopt}, - mg_renumber_map ? std::make_optional>( - (*mg_renumber_map).data(), (*mg_renumber_map).size()) - : std::nullopt); + std::tie(d_mg_srcs, d_mg_dsts, d_mg_weights, std::ignore, std::ignore) = + cugraph::decompress_to_edgelist( + *handle_, + mg_storage_transposed_graph.view(), + mg_storage_transposed_edge_weights + ? std::make_optional((*mg_storage_transposed_edge_weights).view()) + : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + mg_renumber_map ? std::make_optional>( + (*mg_renumber_map).data(), (*mg_renumber_map).size()) + : std::nullopt); // 3-2. aggregate MG results @@ -165,12 +167,14 @@ class Tests_MGTransposeStorage rmm::device_uvector d_sg_dsts(0, handle_->get_stream()); std::optional> d_sg_weights{std::nullopt}; - std::tie(d_sg_srcs, d_sg_dsts, d_sg_weights, std::ignore) = cugraph::decompress_to_edgelist( - *handle_, - sg_graph.view(), - sg_edge_weights ? std::make_optional((*sg_edge_weights).view()) : std::nullopt, - std::optional>{std::nullopt}, - std::optional>{std::nullopt}); + std::tie(d_sg_srcs, d_sg_dsts, d_sg_weights, std::ignore, std::ignore) = + cugraph::decompress_to_edgelist( + *handle_, + sg_graph.view(), + sg_edge_weights ? std::make_optional((*sg_edge_weights).view()) : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}); // 3-4. compare diff --git a/cpp/tests/structure/mg_transpose_test.cpp b/cpp/tests/structure/mg_transpose_test.cpp index 80cdcae070a..4428f8430d5 100644 --- a/cpp/tests/structure/mg_transpose_test.cpp +++ b/cpp/tests/structure/mg_transpose_test.cpp @@ -126,14 +126,16 @@ class Tests_MGTranspose rmm::device_uvector d_mg_dsts(0, handle_->get_stream()); std::optional> d_mg_weights{std::nullopt}; - std::tie(d_mg_srcs, d_mg_dsts, d_mg_weights, std::ignore) = cugraph::decompress_to_edgelist( - *handle_, - mg_graph.view(), - mg_edge_weights ? std::make_optional((*mg_edge_weights).view()) : std::nullopt, - std::optional>{std::nullopt}, - mg_renumber_map ? std::make_optional>( - (*mg_renumber_map).data(), (*mg_renumber_map).size()) - : std::nullopt); + std::tie(d_mg_srcs, d_mg_dsts, d_mg_weights, std::ignore, std::ignore) = + cugraph::decompress_to_edgelist( + *handle_, + mg_graph.view(), + mg_edge_weights ? std::make_optional((*mg_edge_weights).view()) : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + mg_renumber_map ? std::make_optional>( + (*mg_renumber_map).data(), (*mg_renumber_map).size()) + : std::nullopt); // 4-2. aggregate MG results @@ -161,12 +163,14 @@ class Tests_MGTranspose rmm::device_uvector d_sg_dsts(0, handle_->get_stream()); std::optional> d_sg_weights{std::nullopt}; - std::tie(d_sg_srcs, d_sg_dsts, d_sg_weights, std::ignore) = cugraph::decompress_to_edgelist( - *handle_, - sg_graph.view(), - sg_edge_weights ? std::make_optional((*sg_edge_weights).view()) : std::nullopt, - std::optional>{std::nullopt}, - std::optional>{std::nullopt}); + std::tie(d_sg_srcs, d_sg_dsts, d_sg_weights, std::ignore, std::ignore) = + cugraph::decompress_to_edgelist( + *handle_, + sg_graph.view(), + sg_edge_weights ? std::make_optional((*sg_edge_weights).view()) : std::nullopt, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}, + std::optional>{std::nullopt}); // 4-5. compare diff --git a/cpp/tests/structure/symmetrize_test.cpp b/cpp/tests/structure/symmetrize_test.cpp index 383411ccf2b..a0d7118b098 100644 --- a/cpp/tests/structure/symmetrize_test.cpp +++ b/cpp/tests/structure/symmetrize_test.cpp @@ -214,12 +214,13 @@ class Tests_Symmetrize std::optional> d_org_weights{std::nullopt}; if (symmetrize_usecase.check_correctness) { - std::tie(d_org_srcs, d_org_dsts, d_org_weights, std::ignore) = + std::tie(d_org_srcs, d_org_dsts, d_org_weights, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph.view(), edge_weights ? std::make_optional((*edge_weights).view()) : std::nullopt, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, d_renumber_map_labels ? std::make_optional>((*d_renumber_map_labels).data(), (*d_renumber_map_labels).size()) @@ -249,12 +250,13 @@ class Tests_Symmetrize rmm::device_uvector d_symm_dsts(0, handle.get_stream()); std::optional> d_symm_weights{std::nullopt}; - std::tie(d_symm_srcs, d_symm_dsts, d_symm_weights, std::ignore) = + std::tie(d_symm_srcs, d_symm_dsts, d_symm_weights, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph.view(), edge_weights ? std::make_optional((*edge_weights).view()) : std::nullopt, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, d_renumber_map_labels ? std::make_optional>((*d_renumber_map_labels).data(), (*d_renumber_map_labels).size()) diff --git a/cpp/tests/structure/transpose_storage_test.cpp b/cpp/tests/structure/transpose_storage_test.cpp index c4f2523727c..144cebd98d6 100644 --- a/cpp/tests/structure/transpose_storage_test.cpp +++ b/cpp/tests/structure/transpose_storage_test.cpp @@ -78,12 +78,13 @@ class Tests_TransposeStorage rmm::device_uvector d_org_dsts(0, handle.get_stream()); std::optional> d_org_weights{std::nullopt}; if (transpose_storage_usecase.check_correctness) { - std::tie(d_org_srcs, d_org_dsts, d_org_weights, std::ignore) = + std::tie(d_org_srcs, d_org_dsts, d_org_weights, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph.view(), edge_weights ? std::make_optional((*edge_weights).view()) : std::nullopt, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, d_renumber_map_labels ? std::make_optional>((*d_renumber_map_labels).data(), (*d_renumber_map_labels).size()) @@ -118,6 +119,7 @@ class Tests_TransposeStorage std::tie(d_storage_transposed_srcs, d_storage_transposed_dsts, d_storage_transposed_weights, + std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, @@ -126,6 +128,7 @@ class Tests_TransposeStorage ? std::make_optional((*storage_transposed_edge_weights).view()) : std::nullopt, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, d_renumber_map_labels ? std::make_optional>((*d_renumber_map_labels).data(), (*d_renumber_map_labels).size()) diff --git a/cpp/tests/structure/transpose_test.cpp b/cpp/tests/structure/transpose_test.cpp index c748926b749..eba99b52730 100644 --- a/cpp/tests/structure/transpose_test.cpp +++ b/cpp/tests/structure/transpose_test.cpp @@ -78,12 +78,13 @@ class Tests_Transpose rmm::device_uvector d_org_dsts(0, handle.get_stream()); std::optional> d_org_weights{std::nullopt}; if (transpose_usecase.check_correctness) { - std::tie(d_org_srcs, d_org_dsts, d_org_weights, std::ignore) = + std::tie(d_org_srcs, d_org_dsts, d_org_weights, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph.view(), edge_weights ? std::make_optional((*edge_weights).view()) : std::nullopt, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, d_renumber_map_labels ? std::make_optional>((*d_renumber_map_labels).data(), (*d_renumber_map_labels).size()) @@ -109,12 +110,14 @@ class Tests_Transpose rmm::device_uvector d_transposed_dsts(0, handle.get_stream()); std::optional> d_transposed_weights{std::nullopt}; - std::tie(d_transposed_srcs, d_transposed_dsts, d_transposed_weights, std::ignore) = + std::tie( + d_transposed_srcs, d_transposed_dsts, d_transposed_weights, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph.view(), edge_weights ? std::make_optional((*edge_weights).view()) : std::nullopt, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, d_renumber_map_labels ? std::make_optional>((*d_renumber_map_labels).data(), (*d_renumber_map_labels).size()) diff --git a/cpp/tests/utilities/conversion_utilities_impl.cuh b/cpp/tests/utilities/conversion_utilities_impl.cuh index fb2af023c03..6eb7357eedd 100644 --- a/cpp/tests/utilities/conversion_utilities_impl.cuh +++ b/cpp/tests/utilities/conversion_utilities_impl.cuh @@ -56,11 +56,12 @@ graph_to_host_compressed_sparse( rmm::device_uvector d_dst(0, handle.get_stream()); std::optional> d_wgt{std::nullopt}; - std::tie(d_src, d_dst, d_wgt, std::ignore) = cugraph::decompress_to_edgelist( + std::tie(d_src, d_dst, d_wgt, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph_view, edge_weight_view, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, renumber_map); if constexpr (is_multi_gpu) { @@ -146,11 +147,12 @@ graph_to_host_coo( rmm::device_uvector d_dst(0, handle.get_stream()); std::optional> d_wgt{std::nullopt}; - std::tie(d_src, d_dst, d_wgt, std::ignore) = cugraph::decompress_to_edgelist( + std::tie(d_src, d_dst, d_wgt, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph_view, edge_weight_view, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, renumber_map); if constexpr (is_multi_gpu) { @@ -206,11 +208,12 @@ graph_to_device_coo( rmm::device_uvector d_dst(0, handle.get_stream()); std::optional> d_wgt{std::nullopt}; - std::tie(d_src, d_dst, d_wgt, std::ignore) = cugraph::decompress_to_edgelist( + std::tie(d_src, d_dst, d_wgt, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph_view, edge_weight_view, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, renumber_map); if constexpr (is_multi_gpu) { @@ -292,11 +295,12 @@ mg_graph_to_sg_graph( rmm::device_uvector d_dst(0, handle.get_stream()); std::optional> d_wgt{std::nullopt}; - std::tie(d_src, d_dst, d_wgt, std::ignore) = cugraph::decompress_to_edgelist( + std::tie(d_src, d_dst, d_wgt, std::ignore, std::ignore) = cugraph::decompress_to_edgelist( handle, graph_view, edge_weight_view, std::optional>{std::nullopt}, + std::optional>{std::nullopt}, renumber_map); d_src = cugraph::test::device_gatherv( diff --git a/cpp/tests/utilities/debug_utilities_impl.hpp b/cpp/tests/utilities/debug_utilities_impl.hpp index d4b9f356e96..d30c4b3ac85 100644 --- a/cpp/tests/utilities/debug_utilities_impl.hpp +++ b/cpp/tests/utilities/debug_utilities_impl.hpp @@ -31,9 +31,9 @@ void print_edges( std::optional> edge_weight_view, std::optional> renumber_map) { - auto [srcs, dsts, weights, edge_ids] = - cugraph::decompress_to_edgelist( - handle, graph_view, edge_weight_view, std::nullopt, renumber_map); + auto [srcs, dsts, weights, edge_ids, edge_types] = cugraph:: + decompress_to_edgelist( + handle, graph_view, edge_weight_view, std::nullopt, std::nullopt, renumber_map); raft::print_device_vector("srcs", srcs.data(), srcs.size(), std::cout); raft::print_device_vector("dsts", dsts.data(), dsts.size(), std::cout); if (weights) {