reduce_v.cuh#
-
namespace cugraph
Functions
-
template<typename GraphViewType, typename ReduceOp, typename VertexValueInputIterator, typename T>
T reduce_v( - raft::handle_t const &handle,
- GraphViewType const &graph_view,
- VertexValueInputIterator vertex_value_input_first,
- T init,
- ReduceOp reduce_op,
- bool do_expensive_check = false
Reduce the input vertex property values.
This function is inspired by thrust::reduce().
- Template Parameters:
GraphViewType – Type of the passed non-owning graph object.
ReduceOp – Type of the binary reduction operator.
VertexValueInputIterator – Type of the iterator for vertex property values.
T – Type of the initial value. T should be an arithmetic type or cuda::std::tuple of arithmetic types.
- 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.
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 asvertex_value_input_first+graph_view.local_vertex_partition_range_size().init – Initial value to be reduced with the reduced input vertex property values.
reduce_op – Binary operator that takes two input arguments and reduce the two values to one. There are pre-defined reduction operators in include/cugraph/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.do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
T Reduced input vertex property values.
-
template<typename GraphViewType, typename VertexValueInputIterator, typename T>
T reduce_v( - raft::handle_t const &handle,
- GraphViewType const &graph_view,
- VertexValueInputIterator vertex_value_input_first,
- T init,
- bool do_expensive_check = false
Reduce the input vertex property values.
This function is inspired by thrust::reduce().
- Template Parameters:
GraphViewType – Type of the passed non-owning graph object.
ReduceOp – Type of the binary reduction operator.
VertexValueInputIterator – Type of the iterator for vertex property values.
T – Type of the initial value. T should be an arithmetic type or cuda::std::tuple of arithmetic types.
- 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.
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 asvertex_value_input_first+graph_view.local_vertex_partition_range_size().init – Initial value to be added to the reduced input vertex property values.
do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
T Reduced input vertex property values.
-
template<typename GraphViewType, typename VertexValueInputIterator>
auto reduce_v( - raft::handle_t const &handle,
- GraphViewType const &graph_view,
- VertexValueInputIterator vertex_value_input_first,
- bool do_expensive_check = false
Reduce the input vertex property values.
This function is inspired by thrust::reduce().
- Template Parameters:
GraphViewType – Type of the passed non-owning graph object.
VertexValueInputIterator – Type of the iterator for vertex property values.
T – Type of the initial value. T should be an arithmetic type or cuda::std::tuple of arithmetic types.
- 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.
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 asvertex_value_input_first+graph_view.local_vertex_partition_range_size().do_expensive_check – A flag to run expensive checks for input arguments (if set to
true).
- Returns:
Reduced input vertex property values.
-
template<typename GraphViewType, typename ReduceOp, typename VertexValueInputIterator, typename T>