MasterJH5574 commented on a change in pull request #10420:
URL: https://github.com/apache/tvm/pull/10420#discussion_r817249243



##########
File path: src/tir/schedule/analysis/analysis.cc
##########
@@ -363,6 +363,26 @@ void CheckCompleteOrReductionBlock(const ScheduleState& 
self, const StmtSRef& bl
                                          reduction_block_error_code);
 }
 
+StmtSRef GetInnermostDominantSubBlockSRef(const ScheduleState& self, const 
StmtSRef& block_sref) {

Review comment:
       Would you like to add some document for this function?

##########
File path: src/tir/schedule/analysis/analysis.cc
##########
@@ -363,6 +363,26 @@ void CheckCompleteOrReductionBlock(const ScheduleState& 
self, const StmtSRef& bl
                                          reduction_block_error_code);
 }
 
+StmtSRef GetInnermostDominantSubBlockSRef(const ScheduleState& self, const 
StmtSRef& block_sref) {
+  // return the innermost dominant sub-block.
+  const BlockNode* block = TVM_SREF_TO_BLOCK(block, block_sref);
+  bool all_iter_vars_data_parallel = true;
+  for (const IterVar& iter_var : block->iter_vars) {
+    if (iter_var->iter_type != kDataPar) {
+      all_iter_vars_data_parallel = false;
+    }
+  }
+  Array<StmtSRef> child_block_srefs = GetChildBlockSRefOnSRefTree(self, 
block_sref);
+  if (!block->init.defined() && child_block_srefs.size() == 1 && 
all_iter_vars_data_parallel) {
+    const StmtSRef& child_block_sref = child_block_srefs[0];
+    if (IsDominantBlock(self->GetBlockScope(block_sref), child_block_sref)) {

Review comment:
       Heyyy I'm curious that why we require the child's dominance property?

##########
File path: tests/python/unittest/test_tir_schedule_bind.py
##########
@@ -0,0 +1,53 @@
+# Licensed to the Apache Software Foundation (ASF) under one

Review comment:
       The unittests for `bind`, `vectorize`, `parallel` and `unroll` is in 
`test_tir_schedule_for_kind.py` :eyes:
   
   
https://github.com/apache/tvm/blob/main/tests/python/unittest/test_tir_schedule_for_kind.py
   




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


Reply via email to