legate.core.Runtime.tree_reduce#

Runtime.tree_reduce(self, Library library, int64_t task_id, LogicalStore store, int64_t radix=4) LogicalStore#

Performs a user-defined reduction by building a tree of reduction tasks. At each step, the reducer task gets up to radix input stores and is supposed to produce outputs in a single unbound store.

Parameters:
  • library (Library) – Library to which the task id belongs

  • task_id (int) – Id of the reducer task

  • store (LogicalStore) – LogicalStore to perform reductions on

  • radix (int) – Fan-in of each reducer task. If the store is partitioned into \(N\) sub-stores by the runtime, then the first level of reduction tree has \(\ceil{N / \mathtt{radix}}\) reducer tasks.

Returns:

LogicalStore that contains reduction results

Return type:

LogicalStore