transform_reduce_src_dst_nbr_intersection_of_e_endpoints_by_v.cuh#

namespace cugraph

Functions

template<typename GraphViewType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename IntersectionOp, typename T, typename VertexValueOutputIterator>
void transform_reduce_src_nbr_intersection_of_e_endpoints_by_v(
raft::handle_t const &handle,
GraphViewType const &graph_view,
EdgeSrcValueInputWrapper edge_src_value_input,
EdgeDstValueInputWrapper edge_dst_value_input,
IntersectionOp intersection_op,
T init,
VertexValueOutputIterator vertex_value_output_first,
bool do_expensive_check = false
)

Iterate over each edge and apply a functor to the common source neighbor list of the edge endpoints, reduce the functor output values per-vertex.

Iterate over every edge; intersect source neighbor lists of source vertex & destination vertex; invoke a user-provided functor per intersection, and reduce the functor output values (cuda::std::tuple of three values having the same type: one for source, one for destination, and one for every vertex in the intersection) per-vertex. We may add transform_reduce_triplet_of_src_nbr_intersection_of_e_endpoints_by_v in the future to allow emitting different values for different vertices in the intersection of edge endpoints. This function is inspired by thrust::transform_reduce().

Template Parameters:
  • GraphViewType – Type of the passed non-owning graph object.

  • EdgeSrcValueInputWrapper – Type of the wrapper for edge source property values.

  • EdgeDstValueInputWrapper – Type of the wrapper for edge destination property values.

  • IntersectionOp – Type of the quinary per intersection operator.

  • T – Type of the initial value for per-vertex reduction.

  • VertexValueOutputIterator – Type of the iterator for vertex output property variables.

Parameters:
  • handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.

  • graph_view – Non-owning graph object.

  • edge_src_value_input – Wrapper used to access source input property values (for the edge sources assigned to this process in multi-GPU). Use either cugraph::edge_src_property_t::view() (if intersection_op needs to access source property values) or cugraph::edge_src_dummy_property_t::view() (if intersection_op does not access source property values). Use update_edge_src_property to fill the wrapper.

  • edge_dst_value_input – Wrapper used to access destination input property values (for the edge destinations assigned to this process in multi-GPU). Use either cugraph::edge_dst_property_t::view() (if intersection_op needs to access destination property values) or cugraph::edge_dst_dummy_property_t::view() (if intersection_op does not access destination property values). Use update_edge_dst_property to fill the wrapper.

  • intersection_op – quinary operator takes edge source, edge destination, property values for the source, property values for the destination, and a list of vertices in the intersection of edge source & destination vertices’ source neighbors and returns a cuda::std::tuple of three values: one value per source vertex, one value for destination vertex, and one value for every vertex in the intersection.

  • init – Initial value to be added to the reduced intersection_op return values for each vertex.

  • vertex_value_output_first – Iterator pointing to the vertex property variables for the first (inclusive) vertex (assigned to this process in multi-GPU). vertex_value_output_last (exclusive) is deduced as vertex_value_output_first + graph_view.local_vertex_partition_range_size().

  • A – flag to run expensive checks for input arguments (if set to true).

template<typename GraphViewType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename IntersectionOp, typename T, typename VertexValueOutputIterator>
void transform_reduce_dst_nbr_intersection_of_e_endpoints_by_v(
raft::handle_t const &handle,
GraphViewType const &graph_view,
EdgeSrcValueInputWrapper edge_src_value_input,
EdgeDstValueInputWrapper edge_dst_value_input,
IntersectionOp intersection_op,
T init,
VertexValueOutputIterator vertex_value_output_first,
bool do_expensive_check = false
)

Iterate over each edge and apply a functor to the common destination neighbor list of the edge endpoints, reduce the functor output values per-vertex.

Iterate over every edge; intersect destination neighbor lists of source vertex & destination vertex; invoke a user-provided functor per intersection, and reduce the functor output values (cuda::std::tuple of three values having the same type: one for source, one for destination, and one for every vertex in the intersection) per-vertex. We may add transform_reduce_triplet_of_dst_nbr_intersection_of_e_endpoints_by_v in the future to allow emitting different values for different vertices in the intersection of edge endpoints. This function is inspired by thrust::transform_reduce().

Template Parameters:
  • GraphViewType – Type of the passed non-owning graph object.

  • EdgeSrcValueInputWrapper – Type of the wrapper for edge source property values.

  • EdgeDstValueInputWrapper – Type of the wrapper for edge destination property values.

  • IntersectionOp – Type of the quinary per intersection operator.

  • T – Type of the initial value for per-vertex reduction.

  • VertexValueOutputIterator – Type of the iterator for vertex output property variables.

Parameters:
  • handle – RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and handles to various CUDA libraries) to run graph algorithms.

  • graph_view – Non-owning graph object.

  • edge_src_value_input – Wrapper used to access source input property values (for the edge sources assigned to this process in multi-GPU). Use either cugraph::edge_src_property_t::view() (if intersection_op needs to access source property values) or cugraph::edge_src_dummy_property_t::view() (if intersection_op does not access source property values). Use update_edge_src_property to fill the wrapper.

  • edge_dst_value_input – Wrapper used to access destination input property values (for the edge destinations assigned to this process in multi-GPU). Use either cugraph::edge_dst_property_t::view() (if intersection_op needs to access destination property values) or cugraph::edge_dst_dummy_property_t::view() (if intersection_op does not access destination property values). Use update_edge_dst_property to fill the wrapper.

  • intersection_op – quinary operator takes edge source, edge destination, property values for the source, property values for the destination, and a list of vertices in the intersection of edge source & destination vertices’ destination neighbors and returns a cuda::std::tuple of three values: one value per source vertex, one value for destination vertex, and one value for every vertex in the intersection.

  • init – Initial value to be added to the reduced intersection_op return values for each vertex.

  • vertex_value_output_first – Iterator pointing to the vertex property variables for the first (inclusive) vertex (assigned to this process in multi-GPU). vertex_value_output_last (exclusive) is deduced as vertex_value_output_first + graph_view.local_vertex_partition_range_size().

  • A – flag to run expensive checks for input arguments (if set to true).

namespace detail

Functions

template<typename vertex_t, typename ValueBuffer>
std::tuple<rmm::device_uvector<vertex_t>, ValueBuffer> sort_and_reduce_by_vertices(
raft::handle_t const &handle,
rmm::device_uvector<vertex_t> &&vertices,
ValueBuffer &&value_buffer
)
template<typename GraphViewType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename IntersectionOp, typename T, typename VertexValueOutputIterator>
void transform_reduce_minor_nbr_intersection_of_e_endpoints_by_v(
raft::handle_t const &handle,
GraphViewType const &graph_view,
EdgeSrcValueInputWrapper edge_src_value_input,
EdgeDstValueInputWrapper edge_dst_value_input,
IntersectionOp intersection_op,
T init,
VertexValueOutputIterator vertex_value_output_first,
bool do_expensive_check = false
)
template<typename vertex_t, typename VertexValueOutputIterator>
struct accumulate_vertex_property_t

Public Types

using value_type = typename thrust::iterator_traits<VertexValueOutputIterator>::value_type#

Public Functions

inline __device__ void operator() (cuda::std::tuple< vertex_t, value_type > pair) const

Public Members

vertex_t local_vertex_partition_range_first = {}#
VertexValueOutputIterator vertex_value_output_first = {}#
property_op<value_type, cuda::std::plus> vertex_property_add = {}#
template<typename GraphViewType, typename VertexValueInputIterator, typename EdgeValueInputIterator, typename IntersectionOp, typename VertexPairIndexIterator, typename VertexPairIterator, typename VertexPairValueOutputIterator>
struct call_intersection_op_t
template<typename VertexPairIterator>
struct compute_chunk_id_t
template<typename vertex_t, typename ValueIterator>
struct segmented_fill_t