reduce_v.cuh#
-
namespace cugraph
Functions
-
template<typename GraphViewType, typename ReduceOp, typename VertexValueInputWrapper, typename T>
T reduce_v( - raft::handle_t const &handle,
- GraphViewType const &graph_view,
- VertexValueInputWrapper vertex_value_input,
- 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.
VertexValueInputWrapper – Type of the wrapper 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 – Wrapper used to access vertex property values (for the vertices assigned to this process in multi-GPU).
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 VertexValueInputWrapper, typename T>
T reduce_v( - raft::handle_t const &handle,
- GraphViewType const &graph_view,
- VertexValueInputWrapper vertex_value_input,
- 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.
VertexValueInputWrapper – Type of the wrapper 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 – Wrapper used to access vertex property values (for the vertices assigned to this process in multi-GPU).
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 VertexValueInputWrapper>
auto reduce_v( - raft::handle_t const &handle,
- GraphViewType const &graph_view,
- VertexValueInputWrapper vertex_value_input,
- 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.
VertexValueInputWrapper – Type of the wrapper 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 – Wrapper used to access vertex property values (for the vertices assigned to this process in multi-GPU).
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 VertexValueInputWrapper, typename T>