1#ifndef FREE_TENSOR_MAKE_NESTED_LOOPS_H
2#define FREE_TENSOR_MAKE_NESTED_LOOPS_H
19template <
class Titers,
class Tbegins,
class Tends,
class Tsteps,
class Tlens,
20 class Tproperties,
class Tbody>
22 Tsteps &&steps, Tlens &&lens, Tproperties &&properties,
24 Stmt ret = std::forward<Tbody>(body);
25 for (
auto &&[_iter, begin, _end, step, _len, property] : views::reverse(
26 views::zip(iters, begins, ends, steps, lens, properties))) {
27 std::string *iter =
nullptr;
28 if constexpr (std::is_same_v<std::decay_t<
decltype(_iter)>,
31 }
else if constexpr (std::is_same_v<std::decay_t<
decltype(_iter)>,
34 iter = &_iter.template as<VarNode>()->name_;
38 auto &&end = ((
Expr)_end).isValid()
44 ret =
makeFor(*iter, begin, end, step, len, property, ret);
bool isValid() const
Definition: ref.h:89
#define ASSERT(expr)
Definition: except.h:152
Definition: allocator.h:9
Expr makeMul(T &&lhs, U &&rhs, std::source_location loc=std::source_location::current())
Definition: expr.h:202
Expr makeAdd(T &&lhs, U &&rhs, std::source_location loc=std::source_location::current())
Definition: expr.h:174
Expr makeCeilDiv(T &&lhs, U &&rhs, std::source_location loc=std::source_location::current())
Definition: expr.h:259
Stmt makeNestedLoops(Titers &&iters, Tbegins &&begins, Tends &&ends, Tsteps &&steps, Tlens &&lens, Tproperties &&properties, Tbody &&body)
Definition: make_nested_loops.h:21
Expr makeSub(T &&lhs, U &&rhs, std::source_location loc=std::source_location::current())
Definition: expr.h:188
Stmt makeFor(const std::string &iter, Tbegin &&begin, Tend &&end, Tstep &&step, Tlen &&len, Tproperty &&property, Tbody &&body, const Metadata &metadata=nullptr, const ID &id={}, std::source_location loc=std::source_location::current())
Definition: stmt.h:311
Ref< ExprNode > Expr
Definition: ast.h:184