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 2021/01/19 00:57:22 UTC

[GitHub] [tvm] jcf94 commented on a change in pull request #7306: [TIR][REFACTOR] ForNode introduce thread binding and remove legacy field

jcf94 commented on a change in pull request #7306:
URL: https://github.com/apache/tvm/pull/7306#discussion_r559852134



##########
File path: python/tvm/tir/ir_builder.py
##########
@@ -249,17 +249,17 @@ def for_range(self, begin, end, name="i", dtype="int32", for_type="serial"):
         extent = end if begin == 0 else (end - begin)
 
         def _exit_cb():
-            if for_type == "serial":
-                for_type_id = 0
-            elif for_type == "parallel":
-                for_type_id = 1
-            elif for_type == "vectorize":
-                for_type_id = 2
-            elif for_type == "unroll":
-                for_type_id = 3
+            if kind == "serial":
+                kind_id = 0
+            elif kind == "parallel":
+                kind_id = 1
+            elif kind == "vectorize":
+                kind_id = 2
+            elif kind == "unroll":
+                kind_id = 3

Review comment:
       ```suggestion
               if kind == "serial":
                   kind_id = ForKind.SERIAL
               elif kind == "parallel":
                   kind_id = ForKind.PARALLEL
               elif kind == "vectorize":
                   kind_id = ForKind.VECTORIZED
               elif kind == "unroll":
                   kind_id = ForKind.UNROLLED
   ```
   
   Will it be better to also use ForKind as the input of this function?




----------------------------------------------------------------
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:
users@infra.apache.org