transform_reduce_if_v_frontier_outgoing_e_by_dst.cuh#

namespace cugraph

Functions

template<typename GraphViewType, typename KeyBucketType>
size_t compute_num_out_nbrs_from_frontier(
raft::handle_t const &handle,
GraphViewType const &graph_view,
KeyBucketType const &frontier
)
template<typename GraphViewType, typename KeyBucketType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename EdgeValueInputWrapper, typename EdgeOp, typename ReduceOp, typename PredOp>
std::conditional_t<!std::is_same_v<typename ReduceOp::value_type, void>, std::tuple<dataframe_buffer_type_t<typename KeyBucketType::key_type>, detail::optional_dataframe_buffer_type_t<typename ReduceOp::value_type>>, dataframe_buffer_type_t<typename KeyBucketType::key_type>> transform_reduce_if_v_frontier_outgoing_e_by_dst(
raft::handle_t const &handle,
GraphViewType const &graph_view,
KeyBucketType const &frontier,
EdgeSrcValueInputWrapper edge_src_value_input,
EdgeDstValueInputWrapper edge_dst_value_input,
EdgeValueInputWrapper edge_value_input,
EdgeOp e_op,
ReduceOp reduce_op,
PredOp pred_op,
bool do_expensive_check = false
)

Iterate over outgoing edges from the current vertex frontier and reduce valid edge functor outputs by (tagged-)destination ID.

Edge functor outputs are evaluated if the predicate operator returns true. Vertices are assumed to be tagged if KeyBucketType::key_type is a tuple of a vertex type and a tag type (KeyBucketType::key_type is identical to a vertex type otherwise).

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

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

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

  • PredOp – Type of the quinary predicate operator.

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.

  • frontier – KeyBucketType class object for the current vertex frontier.

  • 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 (tagged-)source, edge destination, property values for the source, destination, and edge and 1) just returns (return value = void, if vertices are not tagged and ReduceOp::value_type is void, in this case, e_op is dummy and won’t be called); 2) returns a value to be reduced (if vertices are not tagged and ReduceOp::value_type is not void); 3) returns a tag (if vertices are tagged and ReduceOp::value_type is void); or 4) returns a tuple of a tag and a value to be reduced (if vertices are tagged and ReduceOp::value_type is not void).

  • reduce_op – Binary operator that takes two input arguments and reduce the two values to one. There are pre-defined reduction operators in 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.

  • pred_op – Quinary predicate operator takes edge (tagged-)source, edge destination, property values for the source, destination, and edge and returns whether this edge should be included (if true is returned) or excluded.

Returns:

Tuple of key values and payload values (if ReduceOp::value_type is not void) or just key values (if ReduceOp::value_type is void). Keys in the return values are sorted in ascending order using a vertex ID as the primary key and a tag (if relevant) as the secondary key.

namespace detail

Functions

template<typename priority_t, typename vertex_t, typename payload_t>
std::tuple<rmm::device_uvector<vertex_t>, optional_dataframe_buffer_type_t<payload_t>> filter_buffer_elements(
raft::handle_t const &handle,
rmm::device_uvector<vertex_t> &&unique_v_buffer,
optional_dataframe_buffer_type_t<payload_t> &&payload_buffer,
raft::device_span<vertex_t const> vertex_partition_range_offsets,
vertex_t allreduce_count_per_rank,
int subgroup_size
)
template<typename input_key_t, typename key_t, typename payload_t, typename ReduceOp>
std::tuple<dataframe_buffer_type_t<key_t>, optional_dataframe_buffer_type_t<payload_t>> sort_and_reduce_buffer_elements(
raft::handle_t const &handle,
dataframe_buffer_type_t<input_key_t> &&key_buffer,
optional_dataframe_buffer_type_t<payload_t> &&payload_buffer,
ReduceOp reduce_op,
std::conditional_t<std::is_integral_v<key_t>, std::tuple<key_t, key_t>, std::byte> vertex_range,
std::conditional_t<std::is_integral_v<key_t>, key_t, std::byte> unique_prefix_vertex_range_size,
std::optional<input_key_t> invalid_key
)
template<typename GraphViewType, typename KeyBucketType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename EdgeValueInputWrapper, typename EdgeOp, typename ReduceOp, typename PredOp>
std::conditional_t<!std::is_same_v<typename ReduceOp::value_type, void>, std::tuple<dataframe_buffer_type_t<typename KeyBucketType::key_type>, detail::optional_dataframe_buffer_type_t<typename ReduceOp::value_type>>, dataframe_buffer_type_t<typename KeyBucketType::key_type>> transform_reduce_if_v_frontier_outgoing_e_by_dst(
raft::handle_t const &handle,
GraphViewType const &graph_view,
KeyBucketType const &frontier,
EdgeSrcValueInputWrapper edge_src_value_input,
EdgeDstValueInputWrapper edge_dst_value_input,
EdgeValueInputWrapper edge_value_input,
EdgeOp e_op,
ReduceOp reduce_op,
PredOp pred_op,
bool do_expensive_check = false
)

Variables

int32_t constexpr update_v_frontier_from_outgoing_e_kernel_block_size = 512
template<typename key_t, typename payload_t, typename vertex_t, typename src_value_t, typename dst_value_t, typename e_value_t, typename EdgeOp>
struct transform_reduce_if_v_frontier_call_e_op_t

Public Functions

inline __device__ std::conditional_t<!std::is_same_v< key_t, void > &&!std::is_same_v< payload_t, void >, cuda::std::tuple< key_t, payload_t >, std::conditional_t<!std::is_same_v< key_t, void >, key_t, payload_t > > operator() (key_t key, vertex_t dst, src_value_t sv, dst_value_t dv, e_value_t ev) const

Public Members

EdgeOp e_op = {}#