per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh#
-
namespace cugraph
Functions
-
template<typename GraphViewType, typename EdgeSrcValueInputWrapper, typename EdgeValueInputWrapper, typename EdgeDstKeyInputWrapper, typename KVStoreViewType, typename KeyAggregatedEdgeOp, typename ReduceOp, typename T, typename VertexValueOutputIterator>
void per_v_transform_reduce_dst_key_aggregated_outgoing_e( - raft::handle_t const &handle,
- GraphViewType const &graph_view,
- EdgeSrcValueInputWrapper edge_src_value_input,
- EdgeValueInputWrapper edge_value_input,
- EdgeDstKeyInputWrapper edge_dst_key_input,
- KVStoreViewType kv_store_view,
- KeyAggregatedEdgeOp key_aggregated_e_op,
- T init,
- ReduceOp reduce_op,
- VertexValueOutputIterator vertex_value_output_first,
- bool do_expensive_check = false
Iterate over every vertex’s destination key-aggregated outgoing edges to update vertex property values.
This function is inspired by thrust::transform_reduce(). Unlike per_v_transform_reduce_outgoing_e, this function first aggregates outgoing edges by destination keys to support two level reduction for every vertex.
- Template Parameters:
GraphViewType – Type of the passed non-owning graph object.
EdgeSrcValueInputWrapper – Type of the wrapper for edge source property values.
EdgeValueInputWrapper – Type of the wrapper for edge property values.
EdgeDstKeyInputWrapper – Type of the wrapper for edge destination key values.
KVStoreViewType – Type of the (key, value) store. Key type should coincide with vertex type.
KeyAggregatedEdgeOp – Type of the quinary key-aggregated 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_opneeds to access source property values) or cugraph::edge_src_dummy_property_t::view() (ife_opdoes not access source property values). Use update_edge_src_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_opneeds to access edge property values) or cugraph::edge_dummy_property_t::view() (ife_opdoes not access edge property values).edge_dst_key_input – Wrapper used to access destination input key values (for the edge destinations assigned to this process in multi-GPU). Use cugraph::edge_dst_property_t::view(). Use update_edge_dst_property to fill the wrapper.
kv_store_view – view object of the (key, value) store (for the keys assigned to this process in multi-GPU).
cugraph::detail::compute_gpu_id_from_ext_vertex_tis used to map keys to processes). (Key, value) pairs may be provided by transform_reduce_e_by_src_key() or transform_reduce_e_by_dst_key().key_aggregated_e_op – Quinary operator takes 1) edge source, 2) key, 3) *(
edge_partition_src_value_input_first+ i), 4) value for the key stored in the input (key, value) pairs provided bymap_unique_key_first,map_unique_key_last, andmap_value_first(aggregated over the entire set of processes in multi-GPU), and 5) aggregated edge value.init – Initial value to be reduced with the reduced value for each vertex.
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
ReduceOpis 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 asvertex_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).
-
namespace detail
-
template<typename vertex_t, typename edge_value_t, typename e_op_result_t, typename EdgePartitionDeviceView, typename EdgeMajorValueMap, typename EdgePartitionMajorValueInputWrapper, typename EdgeMinorKeyValueMap, typename KeyAggregatedEdgeOp>
struct call_key_aggregated_e_op_t Public Functions
- template<typename edge_value_type = edge_value_t> inline __device__ std::enable_if_t<!std::is_same_v< edge_value_type, cuda::std::nullopt_t >, e_op_result_t > operator() (cuda::std::tuple< vertex_t, vertex_t, edge_value_t > val) const
- template<typename edge_value_type = edge_value_t> inline __device__ std::enable_if_t< std::is_same_v< edge_value_type, cuda::std::nullopt_t >, e_op_result_t > operator() (cuda::std::tuple< vertex_t, vertex_t > val) const
Public Members
-
EdgePartitionDeviceView edge_partition = {}#
-
cuda::std::optional<EdgeMajorValueMap> edge_major_value_map = {}#
-
EdgePartitionMajorValueInputWrapper edge_partition_major_value_input = {}#
-
EdgeMinorKeyValueMap edge_minor_key_value_map = {}#
-
KeyAggregatedEdgeOp key_aggregated_e_op = {}#
-
template<typename vertex_t>
struct invalidate_if_not_first_in_run_t Public Functions
- inline __device__ vertex_t operator() (size_t i) const
-
template<typename vertex_t>
struct is_valid_vertex_t Public Functions
- inline __device__ bool operator() (vertex_t v) const
-
template<typename EdgePartitionDstKeyInputWrapper>
struct minor_to_key_t Public Types
-
using vertex_t = typename EdgePartitionDstKeyInputWrapper::value_type#
Public Functions
- inline __device__ vertex_t operator() (vertex_t minor) const
Public Members
-
EdgePartitionDstKeyInputWrapper edge_partition_dst_key_input = {}#
-
using vertex_t = typename EdgePartitionDstKeyInputWrapper::value_type#
-
template<typename vertex_t>
struct pair_to_binary_partition_id_t Public Functions
- inline __device__ bool operator() (cuda::std::tuple< vertex_t, vertex_t > pair) const
-
template<typename edge_t>
struct rebase_offset_t Public Functions
- inline __device__ edge_t operator() (edge_t offset) const
-
template<typename ReduceOp, typename T>
struct reduce_with_init_t Public Functions
- inline __device__ T operator() (T val) const
-
template<typename vertex_t, typename edge_value_t>
struct tuple_to_minor_comm_rank_t Public Functions
- template<typename edge_value_type = edge_value_t> inline __device__ std::enable_if_t<!std::is_same_v< edge_value_type, cuda::std::nullopt_t >, int > operator() (cuda::std::tuple< vertex_t, vertex_t, edge_value_t > val) const
- template<typename edge_value_type = edge_value_t> inline __device__ std::enable_if_t< std::is_same_v< edge_value_type, cuda::std::nullopt_t >, int > operator() (cuda::std::tuple< vertex_t, vertex_t > val) const
Public Members
-
compute_vertex_partition_id_from_ext_vertex_t<vertex_t> key_func = {}#
-
int minor_comm_size = {}#
-
template<typename vertex_t, bool multi_gpu>
struct vertex_local_offset_t Public Functions
- inline __device__ vertex_t operator() (vertex_t v) const
Public Members
-
vertex_partition_device_view_t<vertex_t, multi_gpu> vertex_partition = {}#
-
template<typename vertex_t, typename edge_value_t, typename e_op_result_t, typename EdgePartitionDeviceView, typename EdgeMajorValueMap, typename EdgePartitionMajorValueInputWrapper, typename EdgeMinorKeyValueMap, typename KeyAggregatedEdgeOp>
-
template<typename GraphViewType, typename EdgeSrcValueInputWrapper, typename EdgeValueInputWrapper, typename EdgeDstKeyInputWrapper, typename KVStoreViewType, typename KeyAggregatedEdgeOp, typename ReduceOp, typename T, typename VertexValueOutputIterator>