tqchen commented on a change in pull request #7829:
URL: https://github.com/apache/tvm/pull/7829#discussion_r612788972



##########
File path: src/tir/ir/script/script_complete.cc
##########
@@ -76,8 +76,15 @@ class ScriptCompleter : public StmtMutator {
     for (const auto& alloc_buffer : op->alloc_buffers) {
       buffer_var_map_->erase(alloc_buffer->data);
     }
+    // Get access detection mask
+    // 0 for provided region, 1 and 3 for need detect read, 2 and 3 for need 
detect write
+    int mask = 0;
+    auto it = op->annotations.find(attr::script_parsing_detect_access);
+    if (it != op->annotations.end()) {
+      mask = Downcast<IntImm>((*it).second)->value;
+    }
     // ignore root block or blocks which already has reads/writes regions
-    if (block->reads.empty() || block->writes.empty()) {
+    if (mask != 0) {

Review comment:
       This is an abstraction being used by the parser(during parsing), but not 
being used as part of standard TIR, so it might be fine here. Happy to change 
to two boolean flags if needed




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to