The current Python binding of ReduceOp returns the reduction variable (rv). However, since we actually create a size-1 buffer for the rv, it is not a register and should be read before other operations. Otherwise, it may cause the following error. (Example: sum(A[i, k] * B[k, j]) + 10)
The current Python binding of ReduceOp returns the reduction variable (rv). However, since we actually create a size-1 buffer for the rv, it is not a register and should be read before other operations. Otherwise, it may cause the following error. (Example:
sum(A[i, k] * B[k, j]) + 10
)where
%9 = "arith.addi"(%5, %8) : (memref<1xi32>, i32) -> memref<1xi32>
tries to add the reduction variable but should load the element first.