You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 28, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: docs/source/semantics.rst
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,8 @@ There is only one reduction operator for the entire statement because
43
43
combinations like :code:`max/+` on different dimensions have different mathematical meanings depending on loop order.
44
44
All reduction operators are considered to be associative and commutative to
45
45
allow for arbitrary order of evaluation.
46
+
Reduction operators may be suffixed with :code:`!` to indicate that the tensor to which values are accumulated should first be initialized with the identity of the reduction operator (e.g., zero for :code:`+`).
47
+
Otherwise, values are accumulated directly to the output or temporary tensor passed to the kernel.
46
48
47
49
Size Expressions
48
50
----------------
@@ -69,7 +71,8 @@ evaluating :code:`rhs_expression` at all points in the iteration space defined
69
71
by the ranges of the loop index variables and reducing into the entry of the
70
72
tensor specified on the left-hand side. The order in which these expressions
71
73
are evaluated should not change the result because the reduction is
72
-
associative and commutative.
74
+
associative and commutative. If :code:`!` is not present, :code:`v` is not
75
+
re-initialized, and the reduction takes into account the existing values in :code:`v`.
0 commit comments