def parse_for(self, node, parent): with self._for_loop_vars(node) as (iter_var, c_var, extent_var, lower, upper, step, for_type): extent = tir.FloorDiv(tir.Sub(upper, lower), step) return tir.LetStmt( extent_var, extent, tir.For( iter_var, tir.IntImm('int32', 0), extent_var, for_type, tir.LetStmt(c_var, tir.Add(tir.Mul(iter_var, step), lower), self.parse(node.body(), node))))
def parse_op_mul(self, expr, parent): return tir.Mul(self.parse(expr.arg(0), expr), self.parse(expr.arg(1), expr))