Skip to content

Commit bef3b01

Browse files
committed
fix comments
Signed-off-by: Yaoyao Ding <[email protected]>
1 parent 703467e commit bef3b01

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

python/tilus/backends/codegen.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ def visit_ThreadGroupStmt(self, stmt: ThreadGroupStmt) -> None:
288288
cond = (self.current_thread // stmt.num_threads) == (stmt.thread_begin // stmt.num_threads)
289289
tid_value = self.current_thread % stmt.num_threads
290290
else:
291-
cond = logical_and(0 <= self.current_thread, self.current_thread < stmt.thread_begin + stmt.num_threads)
291+
cond = logical_and(
292+
stmt.thread_begin <= self.current_thread, self.current_thread < stmt.thread_begin + stmt.num_threads
293+
)
292294
tid_value = self.current_thread - stmt.thread_begin
293295
with self.builder.if_then(cond=cond):
294296
tid = self.builder.declare_var("tid", tp=int32, init=tid_value)

python/tilus/ir/tools/printer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ def visit_ForStmt(self, stmt: ForStmt) -> Doc:
269269
def visit_ThreadGroupStmt(self, stmt: ThreadGroupStmt) -> Doc:
270270
head_doc = (
271271
NewLine()
272-
+ Text("with thread_group(group_index=")
272+
+ Text("with thread_group(thread_begin=")
273273
+ self.visit(stmt.thread_begin)
274-
+ ", group_size="
274+
+ ", num_threads="
275275
+ self.visit(stmt.num_threads)
276276
+ "):"
277277
)

0 commit comments

Comments
 (0)