transform_e.cuh#

namespace cugraph

Functions

template<typename GraphViewType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename EdgeValueInputWrapper, typename EdgeOp, typename EdgeValueOutputWrapper>
void transform_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,
EdgeValueOutputWrapper edge_value_output,
bool do_expensive_check = false
)

Iterate over the entire set of edges and update edge property values.

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

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

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

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

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

  • EdgeOp – Type of the quinary edge operator.

  • EdgeValueOutputWrapper – Type of the wrapper for output edge property values.

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.

  • edge_value_output – Wrapper used to store edge output property values (for the edges assigned to this process in multi-GPU). Use cugraph::edge_property_t::mutable_view().

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

template<typename GraphViewType, typename EdgeBucketType, typename EdgeSrcValueInputWrapper, typename EdgeDstValueInputWrapper, typename EdgeValueInputWrapper, typename EdgeOp, typename EdgeValueOutputWrapper>
void transform_e(
raft::handle_t const &handle,
GraphViewType const &graph_view,
EdgeBucketType const &edge_list,
EdgeSrcValueInputWrapper edge_src_value_input,
EdgeDstValueInputWrapper edge_dst_value_input,
EdgeValueInputWrapper edge_value_input,
EdgeOp e_op,
EdgeValueOutputWrapper edge_value_output,
bool do_expensive_check = false
)

Iterate over the edges in the input edge list and update edge property values.

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

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

  • EdgeBucketType – Type of the edge bucket class which stores the edge list.

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

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

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

  • EdgeOp – Type of the quinary edge operator.

  • EdgeValueOutputWrapper – Type of the wrapper for output edge property values.

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_list – EdgeBucketType class object storing the edge list to update edge property values.

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

  • edge_value_output – Wrapper used to store edge output property values (for the edges assigned to this process in multi-GPU). Use cugraph::edge_property_t::mutable_view().

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

namespace detail

Functions

template<bool check_edge_mask, typename GraphViewType, typename EdgePartitionSrcValueInputWrapper, typename EdgePartitionDstValueInputWrapper, typename EdgePartitionEdgeValueInputWrapper, typename EdgePartitionEdgeMaskWrapper, typename EdgePartitionEdgeValueOutputWrapper, typename EdgeOp> static __global__ void transform_e_packed_bool (edge_partition_device_view_t< typename GraphViewType::vertex_type, typename GraphViewType::edge_type, GraphViewType::is_multi_gpu > edge_partition, EdgePartitionSrcValueInputWrapper edge_partition_src_value_input, EdgePartitionDstValueInputWrapper edge_partition_dst_value_input, EdgePartitionEdgeValueInputWrapper edge_partition_e_value_input, EdgePartitionEdgeMaskWrapper edge_partition_e_mask, EdgePartitionEdgeValueOutputWrapper edge_partition_e_value_output, EdgeOp e_op)

Variables

int32_t constexpr transform_e_kernel_block_size = 512
template<typename vertex_t, typename edge_t, typename PairIterator, typename MultiEdgeIndexIterator>
struct edge_tuple_from_index_t

Public Functions

inline __device__ cuda::std::tuple< vertex_t, vertex_t, edge_t > operator() (size_t i) const

Public Members

PairIterator pair_first = {}#
cuda::std::optional<MultiEdgeIndexIterator> multi_edge_index_first = {}#
template<bool check_edge_mask, typename GraphViewType, typename EdgePartitionSrcValueInputWrapper, typename EdgePartitionDstValueInputWrapper, typename EdgePartitionEdgeValueInputWrapper, typename EdgePartitionEdgeMaskWrapper, typename EdgeOp, typename EdgeValueOutputWrapper>
struct update_e_value_t

Public Functions

inline __device__ void operator() (cuda::std::tuple< typename GraphViewType::vertex_type, typename GraphViewType::vertex_type, typename GraphViewType::edge_type > edge) const
inline __device__ void operator() (typename GraphViewType::edge_type i) const

Public Members

edge_partition_device_view_t<typename GraphViewType::vertex_type, typename GraphViewType::edge_type, GraphViewType::is_multi_gpu> edge_partition = {}#
EdgePartitionSrcValueInputWrapper edge_partition_src_value_input = {}#
EdgePartitionDstValueInputWrapper edge_partition_dst_value_input = {}#
EdgePartitionEdgeValueInputWrapper edge_partition_e_value_input = {}#
EdgePartitionEdgeMaskWrapper edge_partition_e_mask = {}#
EdgeOp e_op = {}#
EdgeValueOutputWrapper edge_partition_e_value_output = {}#