per_v_transform_reduce_incoming_outgoing_e.cuh#

namespace cugraph

Functions

template<typename GraphViewType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename EdgeValueInputWrapper, typename EdgeOp, typename ReduceOp, typename T, typename VertexValueOutputIterator>
void per_v_transform_reduce_incoming_e(
raft::handle_t const &handle,
GraphViewType const &graph_view,
EdgeSrcValueInputWrapper edge_src_value_input,
EdgeDstValueInputWrapper edge_dst_value_input,
EdgeValueInputWrapper edge_value_input,
EdgeOp e_op,
T init,
ReduceOp reduce_op,
VertexValueOutputIterator vertex_value_output_first,
bool do_expensive_check = false
)

Iterate over every vertex’s incoming edges to update vertex properties.

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.

  • EdgeValueInputWrapper – Type of the wrapper for edge property values.

  • EdgeOp – Type of the quinary edge operator.

  • ReduceOp – Type of the binary reduction 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 e_op needs to access source property values) or cugraph::edge_src_dummy_property_t::view() (if e_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 e_op needs to access destination property values) or cugraph::edge_dst_dummy_property_t::view() (if e_op does not access destination property values). Use update_edge_dst_property to fill the wrapper.

  • edge_value_input – Wrapper used to access edge input property values (for the edges assigned to this process in multi-GPU). Use either cugraph::edge_property_t::view() (if e_op needs to access edge property values) or cugraph::edge_dummy_property_t::view() (if e_op does not access edge property values).

  • e_op – Quinary operator takes edge source, edge destination, property values for the source, destination, and edge and returns a value to be reduced.

  • init – Initial value to be added to the reduced e_op return values for each vertex. If reduce_op is cugraph::reduce_op::any, init value is never selected except for the (tagged-)vertices with 0 outgoing edges.

  • reduce_op – Binary operator that takes two input arguments and reduce the two values to one. There are pre-defined reduction operators in src/prims/reduce_op.cuh. It is recommended to use the pre-defined reduction operators whenever possible as the current (and future) implementations of graph primitives may check whether ReduceOp is a known type (or has known member variables) to take a more optimized code path. See the documentation in the reduce_op.cuh file for instructions on writing custom reduction operators.

  • 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().

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

template<typename GraphViewType, typename KeyBucketType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename EdgeValueInputWrapper, typename EdgeOp, typename ReduceOp, typename T, typename VertexValueOutputIterator>
void per_v_transform_reduce_incoming_e(
raft::handle_t const &handle,
GraphViewType const &graph_view,
KeyBucketType const &key_list,
EdgeSrcValueInputWrapper edge_src_value_input,
EdgeDstValueInputWrapper edge_dst_value_input,
EdgeValueInputWrapper edge_value_input,
EdgeOp e_op,
T init,
ReduceOp reduce_op,
VertexValueOutputIterator vertex_value_output_first,
bool do_expensive_check = false
)

For each (tagged-)vertex in the input (tagged-)vertex list, iterate over the incoming edges to update (tagged-)vertex properties.

This function is inspired by thrust::transform_reduce().

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

  • KeyBucketType – Type of the key bucket class which abstracts the current (tagged-)vertex list.

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

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

  • EdgeValueInputWrapper – Type of the wrapper for edge property values.

  • EdgeOp – Type of the quinary edge operator.

  • ReduceOp – Type of the binary reduction 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.

  • key_list – KeyBucketType class object to store the (tagged-)vertex list to update (tagged-)vertex properties.

  • 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 e_op needs to access source property values) or cugraph::edge_src_dummy_property_t::view() (if e_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 e_op needs to access destination property values) or cugraph::edge_dst_dummy_property_t::view() (if e_op does not access destination property values). Use update_edge_dst_property to fill the wrapper.

  • edge_value_input – Wrapper used to access edge input property values (for the edges assigned to this process in multi-GPU). Use either cugraph::edge_property_t::view() (if e_op needs to access edge property values) or cugraph::edge_dummy_property_t::view() (if e_op does not access edge property values).

  • e_op – Quinary operator takes edge source, edge destination, property values for the source, destination, and edge and returns a value to be reduced.

  • init – Initial value to be reduced with the reduced e_op return values for each vertex. If reduce_op is cugraph::reduce_op::any, init value is never selected except for the (tagged-)vertices with 0 incoming edges.

  • reduce_op – Binary operator that takes two input arguments and reduce the two values to one. There are pre-defined reduction operators in src/prims/reduce_op.cuh. It is recommended to use the pre-defined reduction operators whenever possible as the current (and future) implementations of graph primitives may check whether ReduceOp is a known type (or has known member variables) to take a more optimized code path. See the documentation in the reduce_op.cuh file for instructions on writing custom reduction operators.

  • vertex_value_output_first – Iterator pointing to the (tagged-)vertex property variables for the first (inclusive) (tagged-)vertex in key_list. vertex_value_output_last (exclusive) is deduced as vertex_value_output_first + key_list.size().

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

template<typename GraphViewType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename EdgeValueInputWrapper, typename EdgeOp, typename ReduceOp, typename T, typename VertexValueOutputIterator>
void per_v_transform_reduce_outgoing_e(
raft::handle_t const &handle,
GraphViewType const &graph_view,
EdgeSrcValueInputWrapper edge_src_value_input,
EdgeDstValueInputWrapper edge_dst_value_input,
EdgeValueInputWrapper edge_value_input,
EdgeOp e_op,
T init,
ReduceOp reduce_op,
VertexValueOutputIterator vertex_value_output_first,
bool do_expensive_check = false
)

Iterate over every vertex’s outgoing edges to update vertex properties.

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.

  • EdgeValueInputWrapper – Type of the wrapper for edge property values.

  • EdgeOp – Type of the quinary edge operator.

  • ReduceOp – Type of the binary reduction 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 e_op needs to access source property values) or cugraph::edge_src_dummy_property_t::view() (if e_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 e_op needs to access destination property values) or cugraph::edge_dst_dummy_property_t::view() (if e_op does not access destination property values). Use update_edge_dst_property to fill the wrapper.

  • edge_value_input – Wrapper used to access edge input property values (for the edges assigned to this process in multi-GPU). Use either cugraph::edge_property_t::view() (if e_op needs to access edge property values) or cugraph::edge_dummy_property_t::view() (if e_op does not access edge property values).

  • e_op – Quinary operator takes edge source, edge destination, property values for the source, destination, and edge and returns a value to be reduced.

  • init – Initial value to be added to the reduced e_op return values for each vertex. If reduce_op is cugraph::reduce_op::any, init value is never selected except for the (tagged-)vertices with 0 outgoing edges.

  • reduce_op – Binary operator that takes two input arguments and reduce the two values to one. There are pre-defined reduction operators in src/prims/reduce_op.cuh. It is recommended to use the pre-defined reduction operators whenever possible as the current (and future) implementations of graph primitives may check whether ReduceOp is a known type (or has known member variables) to take a more optimized code path. See the documentation in the reduce_op.cuh file for instructions on writing custom reduction operators.

  • 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().

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

template<typename GraphViewType, typename KeyBucketType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename EdgeValueInputWrapper, typename EdgeOp, typename ReduceOp, typename T, typename VertexValueOutputIterator>
void per_v_transform_reduce_outgoing_e(
raft::handle_t const &handle,
GraphViewType const &graph_view,
KeyBucketType const &key_list,
EdgeSrcValueInputWrapper edge_src_value_input,
EdgeDstValueInputWrapper edge_dst_value_input,
EdgeValueInputWrapper edge_value_input,
EdgeOp e_op,
T init,
ReduceOp reduce_op,
VertexValueOutputIterator vertex_value_output_first,
bool do_expensive_check = false
)

For each (tagged-)vertex in the input (tagged-)vertex list, iterate over the outgoing edges to update (tagged-)vertex properties.

This function is inspired by thrust::transform_reduce().

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

  • KeyBucketType – Type of the key bucket class which abstracts the current (tagged-)vertex list.

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

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

  • EdgeValueInputWrapper – Type of the wrapper for edge property values.

  • EdgeOp – Type of the quinary edge operator.

  • ReduceOp – Type of the binary reduction 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.

  • key_list – KeyBucketType class object to store the (tagged-)vertex list to update (tagged-)vertex properties.

  • 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 e_op needs to access source property values) or cugraph::edge_src_dummy_property_t::view() (if e_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 e_op needs to access destination property values) or cugraph::edge_dst_dummy_property_t::view() (if e_op does not access destination property values). Use update_edge_dst_property to fill the wrapper.

  • edge_value_input – Wrapper used to access edge input property values (for the edges assigned to this process in multi-GPU). Use either cugraph::edge_property_t::view() (if e_op needs to access edge property values) or cugraph::edge_dummy_property_t::view() (if e_op does not access edge property values).

  • e_op – Quinary operator takes edge source, edge destination, property values for the source, destination, and edge and returns a value to be reduced.

  • init – Initial value to be reduced with the reduced e_op return values for each vertex. If reduce_op is cugraph::reduce_op::any, init value is never selected except for the (tagged-)vertices with 0 outgoing edges.

  • reduce_op – Binary operator that takes two input arguments and reduce the two values to one. There are pre-defined reduction operators in src/prims/reduce_op.cuh. It is recommended to use the pre-defined reduction operators whenever possible as the current (and future) implementations of graph primitives may check whether ReduceOp is a known type (or has known member variables) to take a more optimized code path. See the documentation in the reduce_op.cuh file for instructions on writing custom reduction operators.

  • vertex_value_output_first – Iterator pointing to the (tagged-)vertex property variables for the first (inclusive) (tagged-)vertex in key_list. vertex_value_output_last (exclusive) is deduced as vertex_value_output_first + key_list.size().

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