tqchen commented on code in PR #12819:
URL: https://github.com/apache/tvm/pull/12819#discussion_r973330490
##########
src/tir/analysis/buffer_access_lca_detector.cc:
##########
@@ -150,6 +176,17 @@ class LCADetector : public StmtExprVisitor {
}
}
+ void UpdateWithBlockidx() {
+ for (const auto& it : buffer_lca_) {
+ if (GetRef<Buffer>(it.first).scope() == "global") {
Review Comment:
Use StorageScope here
https://github.com/apache/tvm/blob/main/src/runtime/thread_storage_scope.h#L86
Consider move up to the ThreadScope as long as their rank is higher equal
than threadScope.rank
##########
src/tir/analysis/buffer_access_lca_detector.cc:
##########
@@ -107,6 +122,17 @@ class LCADetector : public StmtExprVisitor {
ancestor_scopes_.pop_back();
}
+ void VisitStmt_(const AttrStmtNode* op) final {
+ if (op->attr_key == attr::thread_extent) {
+ const auto* iter = op->node.as<IterVarNode>();
+ ICHECK_NOTNULL(iter);
+ if (StartsWith(iter->thread_tag, "blockIdx.")) {
Review Comment:
Instead of string matching, use ThreadScope here
https://github.com/apache/tvm/blob/main/src/runtime/thread_storage_scope.h#L161
--
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]