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

Update graph/graph primitives API to consistently use vertex/edge centric terminologies instead of matrix centric terminolgies #2187

Merged
merged 18 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
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

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions cpp/include/cugraph/detail/graph_functions.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#pragma once

#include <cugraph/matrix_partition_device_view.cuh>
#include <cugraph/edge_partition_device_view.cuh>
#include <cugraph/partition_manager.hpp>
#include <cugraph/utilities/device_comm.cuh>
#include <cugraph/utilities/host_scalar_comm.cuh>
Expand Down Expand Up @@ -162,10 +162,10 @@ rmm::device_uvector<typename GraphViewType::edge_type> get_active_major_global_d
* are dealt with by the previous partitions.
*/
template <typename GraphViewType>
std::tuple<rmm::device_uvector<matrix_partition_device_view_t<typename GraphViewType::vertex_type,
typename GraphViewType::edge_type,
typename GraphViewType::weight_type,
GraphViewType::is_multi_gpu>>,
std::tuple<rmm::device_uvector<edge_partition_device_view_t<typename GraphViewType::vertex_type,
typename GraphViewType::edge_type,
typename GraphViewType::weight_type,
GraphViewType::is_multi_gpu>>,
rmm::device_uvector<typename GraphViewType::vertex_type>,
rmm::device_uvector<typename GraphViewType::vertex_type>,
rmm::device_uvector<typename GraphViewType::vertex_type>,
Expand Down
16 changes: 8 additions & 8 deletions cpp/include/cugraph/detail/shuffle_wrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ namespace detail {
*
* @param[in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator,
* and handles to various CUDA libraries) to run graph algorithms.
* @param[in] d_edgelist_majors Vertex IDs for rows (if the graph adjacency matrix is stored as is)
* or columns (if the graph adjacency matrix is stored transposed)
* @param[in] d_edgelist_minors Vertex IDs for columns (if the graph adjacency matrix is stored as
* is) or rows (if the graph adjacency matrix is stored transposed)
* @param[in] d_edgelist_majors Vertex IDs for sources (if we are internally storing edges in the
* sparse 2D matrix using sources as major indices) or destinations (otherwise)
* @param[in] d_edgelist_minors Vertex IDs for destinations (if we are internally storing edges in
* the sparse 2D matrix using sources as major indices) or sources (otherwise)
* @param[in] d_edgelist_weights Optional edge weights
*
* @return Tuple of shuffled major vertices, minor vertices and optional weights
Expand Down Expand Up @@ -71,10 +71,10 @@ rmm::device_uvector<vertex_t> shuffle_vertices_by_gpu_id(
*
* @param[in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator,
* and handles to various CUDA libraries) to run graph algorithms.
* @param[in/out] d_edgelist_majors Vertex IDs for rows (if the graph adjacency matrix is stored as
* is) or columns (if the graph adjacency matrix is stored transposed)
* @param[in/out] d_edgelist_minors Vertex IDs for columns (if the graph adjacency matrix is stored
* as is) or rows (if the graph adjacency matrix is stored transposed)
* @param[in/out] d_edgelist_majors Vertex IDs for sources (if we are internally storing edges in
* the sparse 2D matrix using sources as major indices) or destinations (otherwise)
* @param[in/out] d_edgelist_minors Vertex IDs for destinations (if we are internally storing edges
* in the sparse 2D matrix using sources as major indices) or sources (otherwise)
* @param[in/out] d_edgelist_weights Optional edge weights
* @param[in] groupby_and_count_local_partition_by_minor If set to true, groupby and count edges
* based on (local partition ID, GPU ID) pairs (where GPU IDs are computed by applying the
Expand Down
33 changes: 17 additions & 16 deletions cpp/include/cugraph/detail/utility_wrappers.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, NVIDIA CORPORATION.
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -83,42 +83,43 @@ void sequence_fill(rmm::cuda_stream_view const& stream_view,
/**
* @brief Compute the maximum vertex id of an edge list
*
* max(d_edgelist_rows.max(), d_edgelist_cols.max())
* max(d_edgelist_srcs.max(), d_edgelist_dsts.max())
*
* @tparam vertex_t vertex type
* @tparam vertex_t vertex type
*
* @param[in] stream_view stream view
* @param[in] d_edgelist_rows device array to fill
* @param[in] d_edgelist_cols number of elements in array
* @param[in] stream_view stream view
* @param[in] d_edgelist_srcs device array storing edge source IDs
* @param[in] d_edgelist_dsts device array storing edge destination IDs
* @param[in] num_edges number of edges in the input source & destination arrays
*
* @param the maximum value occurring in the edge list
*/
template <typename vertex_t>
vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view,
vertex_t const* d_edgelist_rows,
vertex_t const* d_edgelist_cols,
vertex_t const* d_edgelist_srcs,
vertex_t const* d_edgelist_dsts,
size_t num_edges);

/**
* @brief Compute the maximum vertex id of an edge list
*
* max(d_edgelist_rows.max(), d_edgelist_cols.max())
* max(d_edgelist_srcs.max(), d_edgelist_dsts.max())
*
* @tparam vertex_t vertex type
* @tparam vertex_t vertex type
*
* @param[in] stream_view stream view
* @param[in] d_edgelist_rows device array to fill
* @param[in] d_edgelist_cols number of elements in array
* @param[in] stream_view stream view
* @param[in] d_edgelist_srcs device array storing source IDs
* @param[in] d_edgelist_dsts device array storing destination IDs
*
* @param the maximum value occurring in the edge list
*/
template <typename vertex_t>
vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view,
rmm::device_uvector<vertex_t> const& d_edgelist_rows,
rmm::device_uvector<vertex_t> const& d_edgelist_cols)
rmm::device_uvector<vertex_t> const& d_edgelist_srcs,
rmm::device_uvector<vertex_t> const& d_edgelist_dsts)
{
return compute_maximum_vertex_id(
stream_view, d_edgelist_rows.data(), d_edgelist_cols.data(), d_edgelist_rows.size());
stream_view, d_edgelist_srcs.data(), d_edgelist_dsts.data(), d_edgelist_srcs.size());
}

} // namespace detail
Expand Down
Loading