Shortcuts

Struct Reducer

Struct Documentation

struct ripple::Reducer

This struct appends nodes to a graph which perform a reduction of tensor data into a final result.

It add a node for reduction per partition in the tensor, and a final node to reduce all the partial nodes from the partitions. It sets a reduction result to finished in the final node.

Public Static Functions

template<typename GraphType, typename T, size_t Dims, typename Pred, typename ...Args>
auto reduce(GraphType &graph, ExecutionKind exec_kind, Tensor<T, Dims> &data, ReductionResult<T> &result, Pred &&pred, Args&&... args) noexcept -> void

Implementation of a reduction over the data by creating parallel nodes for each of the blocks in the given tensor and adding them to the given graph.

The result for each node is then reduced into the result using the given predicate.

Parameters
  • graph: The graph to append the reduction nodes to.

  • exec_kind: The kind of the execution for the reduction.

  • data: The data to reduce.

  • result: The result to reduce into.

  • pred: The predicate which defines the reduction operation.

  • args: Additional arguments for the predicate.

Template Parameters
  • GraphType: The type of the graph to append the nodes to.

  • T: The type of the data in the tensor.

  • Dims: The number of dimensions for the tensor.

  • Pred: The type of the predicate for the reduction.

  • Args: The types of the arguments for the predicate.

Docs

Access comprehensive developer documentation for Ripple

View Docs

Tutorials

Get tutorials to help with understand all features

View Tutorials

Examples

Find examples to help get started

View Examples