Hzfengsy commented on a change in pull request #8863:
URL: https://github.com/apache/tvm/pull/8863#discussion_r698210947
##########
File path: include/tvm/tir/schedule/state.h
##########
@@ -128,6 +128,11 @@ class ScheduleStateNode : public Object {
*/
TVM_DLL void Replace(const tir::StmtSRef& src_sref, const Stmt& tgt_stmt,
const Map<Block, Block>& block_sref_reuse);
+ /*!
+ * \brief Recalculate the `affine_binding` flag of the scope block info.
+ * \param scope_sref The sref to the interested scope block.
+ */
+ TVM_DLL void UpdateAffineFlag(const StmtSRef& scope_sref);
Review comment:
In this case, it is not always affine. Please see the following case:
```python
for io in 4:
for ii in 5:
with tir.block([17]) as vi:
tir.bind(vi, io * 4 + ii)
B_shared[vi] = B[vi]
for ii in 4:
with tir.block([16]) as vi:
tir.bind(vi, io * 4 + ii)
A[vi] = tir.max(B_shared[vi], B_shared[vi + 1])
```
There are two options now:
1. Keep this method. I think it's OK because it must be called explicitly in
schedule primitives.
2. Inline the method into primitive (or move it into a private help function
in cc file). Therefore, it may cause duplicate code, since other primitive may
also need it (as compute_at)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]