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



##########
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:
       Can we potentially wrap the masking logic? I think its a bit of a leaky 
abstraction for end users to need to understand low level bit masking, happy to 
have this be a follow up item. 




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