Commit 3c9e262f by ziheng Committed by Tianqi Chen

[FIX] Fix build error: call to 'make_const' is ambiguous (#415)

parent e05f54be
...@@ -123,7 +123,7 @@ class DoubleBufferInjector : public IRMutator { ...@@ -123,7 +123,7 @@ class DoubleBufferInjector : public IRMutator {
Var outer_var(old_loop->loop_var->name_hint + ".outer", old_loop->loop_var.type()); Var outer_var(old_loop->loop_var->name_hint + ".outer", old_loop->loop_var.type());
std::unordered_map<const Variable*, Expr> vmap; std::unordered_map<const Variable*, Expr> vmap;
std::vector<Stmt> loop_seq; std::vector<Stmt> loop_seq;
for (size_t i = 0; i < split_loop_; ++i) { for (int32_t i = 0; i < split_loop_; ++i) {
vmap[old_loop->loop_var.get()] = outer_var * factor + make_const(factor.type(), i); vmap[old_loop->loop_var.get()] = outer_var * factor + make_const(factor.type(), i);
loop_seq.emplace_back(Substitute(old_loop->body, vmap)); loop_seq.emplace_back(Substitute(old_loop->body, vmap));
} }
...@@ -133,7 +133,7 @@ class DoubleBufferInjector : public IRMutator { ...@@ -133,7 +133,7 @@ class DoubleBufferInjector : public IRMutator {
// tail // tail
std::vector<Stmt> tail_seq; std::vector<Stmt> tail_seq;
Stmt tail_body = StripDoubleBufferWrite().Mutate(old_loop->body); Stmt tail_body = StripDoubleBufferWrite().Mutate(old_loop->body);
for (size_t i = 0; i < split_loop_; ++i) { for (int32_t i = 0; i < split_loop_; ++i) {
Expr idx = tail_base + make_const(tail_base.type(), i); Expr idx = tail_base + make_const(tail_base.type(), i);
vmap[old_loop->loop_var.get()] = idx; vmap[old_loop->loop_var.get()] = idx;
tail_seq.emplace_back( tail_seq.emplace_back(
...@@ -238,7 +238,7 @@ class DoubleBufferInjector : public IRMutator { ...@@ -238,7 +238,7 @@ class DoubleBufferInjector : public IRMutator {
std::string scope; std::string scope;
}; };
// Whether split loop // Whether split loop
int split_loop_; int32_t split_loop_;
// Whether we are inside double buffer scope. // Whether we are inside double buffer scope.
bool in_double_buffer_scope_{false}; bool in_double_buffer_scope_{false};
// The current loop next // The current loop next
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment