You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/09/16 19:34:08 UTC

[GitHub] [tvm] tqchen commented on a diff in pull request #12819: [BugFix][TIR] Fix Buffer LCA Detector

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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org