update_v_frontier.cuh#

namespace cugraph

Functions

template<typename GraphViewType, typename KeyBuffer, typename PayloadBuffer, typename VertexFrontierType, typename VertexValueInputIterator, typename VertexValueOutputIterator, typename VertexOp>
void update_v_frontier(
raft::handle_t const &handle,
GraphViewType const &graph_view,
KeyBuffer &&key_buffer,
PayloadBuffer &&payload_buffer,
VertexFrontierType &frontier,
raft::host_span<size_t const> next_frontier_bucket_indices,
VertexValueInputIterator vertex_value_input_first,
VertexValueOutputIterator vertex_value_output_first,
VertexOp v_op,
bool do_expensive_check = false
)

Insert (tagged-)vertices to the vertex frontier and update vertex property values of the newly inserted vertices .

This primitive often works in pair with transform_reduce_if_v_frontier_outgoing_e_by_dst. This version of update_v_frontier takes payload_buffer and @v_op takes a payload value in addition to a (tagged-)vertex and a vertex property value as input arguments.

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

  • KeyBuffer – Type of the buffer storing (tagged-)vertices.

  • PayloadBuffer – Type of the buffer storing payload values.

  • VertexFrontierType – Type of the vertex frontier class which abstracts vertex frontier managements.

  • VertexValueInputIterator – Type of the iterator for input vertex property values.

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

  • VertexOp – Type of the ternary vertex 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.

  • key_buffer – buffer object storing (tagged-)vertices to insert.

  • payload_buffer – buffer object storing payload values for each (tagged-)vertices in the key_buffer.

  • frontier – VertexFrontierType class object for vertex frontier managements. This object includes multiple bucket objects.

  • next_frontier_bucket_indices – Indices of the vertex frontier buckets to store new frontier (tagged-)vertices.

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

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

  • v_op – Ternary operator that takes (tagged-)vertex ID, *(vertex_value_input_first + i) (where i is [0, graph_view.local_vertex_partition_range_size())) and the payload value for the (tagged-)vertex ID and returns a tuple of 1) a cuda::std::optional object optionally storing a bucket index and 2) a cuda::std::optional object optionally storing a new vertex property value. If the first element of the returned tuple is cuda::std::nullopt, this (tagged-)vertex won’t be inserted to the vertex frontier. If the second element is cuda::std::nullopt, the vertex property value for this vertex won’t be updated. Note that it is currently undefined behavior if there are multiple tagged-vertices with the same vertex ID (but with different tags) AND v_op results on the tagged-vertices with the same vertex ID have more than one valid new vertex property values.

template<typename GraphViewType, typename KeyBuffer, typename VertexFrontierType, typename VertexValueInputIterator, typename VertexValueOutputIterator, typename VertexOp>
void update_v_frontier(
raft::handle_t const &handle,
GraphViewType const &graph_view,
KeyBuffer &&key_buffer,
VertexFrontierType &frontier,
raft::host_span<size_t const> next_frontier_bucket_indices,
VertexValueInputIterator vertex_value_input_first,
VertexValueOutputIterator vertex_value_output_first,
VertexOp v_op,
bool do_expensive_check = false
)

Insert (tagged-)vertices to the vertex frontier and update vertex property values of the newly inserted vertices .

This primitive often works in pair with transform_reduce_if_v_frontier_outgoing_e_by_dst. This version of update_v_frontier does not take payload_buffer and @v_op takes a (tagged-)vertex and a vertex property value as input arguments (no payload value in the input parameter list).

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

  • KeyBuffer – Type of the buffer storing (tagged-)vertices.

  • VertexFrontierType – Type of the vertex frontier class which abstracts vertex frontier managements.

  • VertexValueInputIterator – Type of the iterator for input vertex property values.

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

  • VertexOp – Type of the binary vertex 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.

  • key_buffer – buffer object storing (tagged-)vertices to insert.

  • frontier – VertexFrontierType class object for vertex frontier managements. This object includes multiple bucket objects.

  • next_frontier_bucket_indices – Indices of the vertex frontier buckets to store new frontier (tagged-)vertices.

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

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

  • v_op – Binary operator that takes (tagged-)vertex ID, and *(vertex_value_input_first + i) (where i is [0, graph_view.local_vertex_partition_range_size())) and returns a tuple of 1) a cuda::std::optional object optionally storing a bucket index and 2) a cuda::std::optional object optionally storing a new vertex property value. If the first element of the returned tuple is cuda::std::nullopt, this (tagged-)vertex won’t be inserted to the vertex frontier. If the second element is cuda::std::nullopt, the vertex property value for this vertex won’t be updated. Note that it is currently undefined behavior if there are multiple tagged-vertices with the same vertex ID (but with different tags) AND v_op results on the tagged-vertices with the same vertex ID have more than one valid new vertex property values.

namespace detail
template<typename key_t>
struct check_invalid_bucket_idx_t

Public Functions

inline __device__ bool operator() (cuda::std::tuple< uint8_t, key_t > pair)
template<typename vertex_t, typename VertexValueInputIterator, typename VertexValueOutputIterator, typename VertexOp, typename key_t, typename payload_t>
struct update_v_frontier_call_v_op_t

Public Functions

inline __device__ uint8_t operator() (cuda::std::tuple< key_t, payload_t > pair) const

Public Members

VertexValueInputIterator vertex_value_input_first#
VertexValueOutputIterator vertex_value_output_first#
VertexOp v_op#
vertex_t local_vertex_partition_range_first#
template<typename vertex_t, typename VertexValueInputIterator, typename VertexValueOutputIterator, typename VertexOp, typename key_t>
struct update_v_frontier_call_v_op_t<vertex_t, VertexValueInputIterator, VertexValueOutputIterator, VertexOp, key_t, void>

Public Functions

inline __device__ uint8_t operator() (key_t key) const

Public Members

VertexValueInputIterator vertex_value_input_first#
VertexValueOutputIterator vertex_value_output_first#
VertexOp v_op#
vertex_t local_vertex_partition_range_first#