Commit bb97938d by Andrew Adams Committed by Tianqi Chen

Halide -> HalideIR (#698)

parent 75cee522
Subproject commit d91cf97d5d6cd2b47ec408bb08e978b88cbf6ab7 Subproject commit aadbf02d6bd7a545edbf6652494a7b07a97a06c1
...@@ -16,31 +16,31 @@ ...@@ -16,31 +16,31 @@
namespace tvm { namespace tvm {
using Halide::Type; using HalideIR::Type;
using Halide::Float; using HalideIR::Float;
using Halide::Bool; using HalideIR::Bool;
using Halide::Int; using HalideIR::Int;
using Halide::UInt; using HalideIR::UInt;
using Halide::Handle; using HalideIR::Handle;
using Halide::ExprHash; using HalideIR::ExprHash;
using Halide::ExprEqual; using HalideIR::ExprEqual;
using Halide::Expr; using HalideIR::Expr;
using Halide::VarExpr; using HalideIR::VarExpr;
using Halide::IR::RangeNode; using HalideIR::IR::RangeNode;
using Halide::IR::FunctionRef; using HalideIR::IR::FunctionRef;
using Halide::IR::FunctionBaseNode; using HalideIR::IR::FunctionBaseNode;
using Halide::Internal::Stmt; using HalideIR::Internal::Stmt;
using Halide::Internal::IRPrinter; using HalideIR::Internal::IRPrinter;
using Halide::Internal::Variable; using HalideIR::Internal::Variable;
using Halide::Internal::make_const; using HalideIR::Internal::make_const;
using Halide::Internal::make_zero; using HalideIR::Internal::make_zero;
using Halide::Internal::as_const_int; using HalideIR::Internal::as_const_int;
using Halide::Internal::as_const_uint; using HalideIR::Internal::as_const_uint;
using Halide::Internal::const_true; using HalideIR::Internal::const_true;
using Halide::Internal::const_false; using HalideIR::Internal::const_false;
using Halide::Internal::is_no_op; using HalideIR::Internal::is_no_op;
inline Type TVMShapeIndexType() { inline Type TVMShapeIndexType() {
if (std::is_signed<tvm_index_t>::value) { if (std::is_signed<tvm_index_t>::value) {
...@@ -51,7 +51,7 @@ inline Type TVMShapeIndexType() { ...@@ -51,7 +51,7 @@ inline Type TVMShapeIndexType() {
} }
inline Type TVMType2Type(TVMType t) { inline Type TVMType2Type(TVMType t) {
return Type(static_cast<halide_type_code_t>(t.code), t.bits, t.lanes); return Type(static_cast<halideir_type_code_t>(t.code), t.bits, t.lanes);
} }
inline TVMType Type2TVMType(Type t) { inline TVMType Type2TVMType(Type t) {
...@@ -71,7 +71,7 @@ inline int GetVectorBytes(Type dtype) { ...@@ -71,7 +71,7 @@ inline int GetVectorBytes(Type dtype) {
} }
/*! \brief a named variable in TVM */ /*! \brief a named variable in TVM */
class Var : public Halide::VarExpr { class Var : public HalideIR::VarExpr {
public: public:
explicit Var(const std::string& name_hint = "v", explicit Var(const std::string& name_hint = "v",
Type t = Int(32)) : VarExpr(name_hint, t) {} Type t = Int(32)) : VarExpr(name_hint, t) {}
...@@ -94,7 +94,7 @@ class Var : public Halide::VarExpr { ...@@ -94,7 +94,7 @@ class Var : public Halide::VarExpr {
class IterVarNode; class IterVarNode;
/*! /*!
* \brief same as Halide::IR::Range * \brief same as HalideIR::IR::Range
* except it provide an constructor with (begin, end) * except it provide an constructor with (begin, end)
* *
* \note Traditional Halide's Range have a constructor with * \note Traditional Halide's Range have a constructor with
...@@ -102,11 +102,11 @@ class IterVarNode; ...@@ -102,11 +102,11 @@ class IterVarNode;
* We decided to correct it by removing the constructor in HalideIR, * We decided to correct it by removing the constructor in HalideIR,
* and add it back in TVM's range. * and add it back in TVM's range.
*/ */
class Range : public Halide::IR::Range { class Range : public HalideIR::IR::Range {
public: public:
/*! \brief constructor */ /*! \brief constructor */
Range() {} Range() {}
explicit Range(std::shared_ptr<Node> n) : Halide::IR::Range(n) {} explicit Range(std::shared_ptr<Node> n) : HalideIR::IR::Range(n) {}
/*! /*!
* \brief constructor by begin and end * \brief constructor by begin and end
* \param begin The begin of the range. * \param begin The begin of the range.
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
namespace tvm { namespace tvm {
namespace ir { namespace ir {
using Halide::Internal::ExprNode; using HalideIR::Internal::ExprNode;
using Halide::Internal::StmtNode; using HalideIR::Internal::StmtNode;
using Halide::Internal::IRNodeType; using HalideIR::Internal::IRNodeType;
using Halide::Internal::ForType; using HalideIR::Internal::ForType;
using Halide::DeviceAPI; using HalideIR::DeviceAPI;
// Node container for CommReducer // Node container for CommReducer
struct CommReducerNode; struct CommReducerNode;
...@@ -433,50 +433,50 @@ enum TVMStructFieldKind : int { ...@@ -433,50 +433,50 @@ enum TVMStructFieldKind : int {
} // namespace intrinsic } // namespace intrinsic
// Reuse IR node defintiion from HalideIR // Reuse IR node defintiion from HalideIR
using Halide::Internal::IntImm; using HalideIR::Internal::IntImm;
using Halide::Internal::UIntImm; using HalideIR::Internal::UIntImm;
using Halide::Internal::FloatImm; using HalideIR::Internal::FloatImm;
using Halide::Internal::StringImm; using HalideIR::Internal::StringImm;
using Halide::Internal::Cast; using HalideIR::Internal::Cast;
using Halide::Internal::Add; using HalideIR::Internal::Add;
using Halide::Internal::Sub; using HalideIR::Internal::Sub;
using Halide::Internal::Mul; using HalideIR::Internal::Mul;
using Halide::Internal::Div; using HalideIR::Internal::Div;
using Halide::Internal::Mod; using HalideIR::Internal::Mod;
using Halide::Internal::Min; using HalideIR::Internal::Min;
using Halide::Internal::Max; using HalideIR::Internal::Max;
using Halide::Internal::EQ; using HalideIR::Internal::EQ;
using Halide::Internal::NE; using HalideIR::Internal::NE;
using Halide::Internal::LT; using HalideIR::Internal::LT;
using Halide::Internal::LE; using HalideIR::Internal::LE;
using Halide::Internal::GT; using HalideIR::Internal::GT;
using Halide::Internal::GE; using HalideIR::Internal::GE;
using Halide::Internal::And; using HalideIR::Internal::And;
using Halide::Internal::Or; using HalideIR::Internal::Or;
using Halide::Internal::Not; using HalideIR::Internal::Not;
using Halide::Internal::Select; using HalideIR::Internal::Select;
using Halide::Internal::Load; using HalideIR::Internal::Load;
using Halide::Internal::Ramp; using HalideIR::Internal::Ramp;
using Halide::Internal::Broadcast; using HalideIR::Internal::Broadcast;
using Halide::Internal::Call; using HalideIR::Internal::Call;
using Halide::Internal::Let; using HalideIR::Internal::Let;
using Halide::Internal::LetStmt; using HalideIR::Internal::LetStmt;
using Halide::Internal::AttrStmt; using HalideIR::Internal::AttrStmt;
using Halide::Internal::AssertStmt; using HalideIR::Internal::AssertStmt;
using Halide::Internal::ProducerConsumer; using HalideIR::Internal::ProducerConsumer;
using Halide::Internal::For; using HalideIR::Internal::For;
using Halide::Internal::Store; using HalideIR::Internal::Store;
using Halide::Internal::Provide; using HalideIR::Internal::Provide;
using Halide::Internal::Allocate; using HalideIR::Internal::Allocate;
using Halide::Internal::Free; using HalideIR::Internal::Free;
using Halide::Internal::Realize; using HalideIR::Internal::Realize;
using Halide::Internal::Prefetch; using HalideIR::Internal::Prefetch;
using Halide::Internal::Block; using HalideIR::Internal::Block;
using Halide::Internal::IfThenElse; using HalideIR::Internal::IfThenElse;
using Halide::Internal::Evaluate; using HalideIR::Internal::Evaluate;
using Halide::Internal::Shuffle; using HalideIR::Internal::Shuffle;
// ir functions // ir functions
using Halide::Internal::is_const_power_of_two_integer; using HalideIR::Internal::is_const_power_of_two_integer;
} // namespace ir } // namespace ir
} // namespace tvm } // namespace tvm
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
namespace tvm { namespace tvm {
using Halide::likely; using HalideIR::likely;
using Halide::likely_if_innermost; using HalideIR::likely_if_innermost;
// functions // functions
using Halide::cast; using HalideIR::cast;
using Halide::min; using HalideIR::min;
using Halide::max; using HalideIR::max;
using Halide::abs; using HalideIR::abs;
using Halide::select; using HalideIR::select;
/*! /*!
* \brief sum of of source expression over axis * \brief sum of of source expression over axis
......
...@@ -104,7 +104,7 @@ inline TNodeRef TVMArgValue::AsNodeRef() const { ...@@ -104,7 +104,7 @@ inline TNodeRef TVMArgValue::AsNodeRef() const {
return TNodeRef(sptr); return TNodeRef(sptr);
} }
inline TVMArgValue::operator Halide::Expr() const { inline TVMArgValue::operator HalideIR::Expr() const {
if (type_code_ == kNull) return Expr(); if (type_code_ == kNull) return Expr();
if (type_code_ == kDLInt) { if (type_code_ == kDLInt) {
return Expr(static_cast<int>(value_.v_int64)); return Expr(static_cast<int>(value_.v_int64));
...@@ -184,20 +184,20 @@ inline void TVMArgsSetter::operator()(size_t i, const NodeRef& other) const { / ...@@ -184,20 +184,20 @@ inline void TVMArgsSetter::operator()(size_t i, const NodeRef& other) const { /
} }
// type related stuffs // type related stuffs
inline TVMRetValue& TVMRetValue::operator=(const Halide::Type& t) { inline TVMRetValue& TVMRetValue::operator=(const HalideIR::Type& t) {
return this->operator=(Type2TVMType(t)); return this->operator=(Type2TVMType(t));
} }
inline TVMRetValue::operator Halide::Type() const { inline TVMRetValue::operator HalideIR::Type() const {
return TVMType2Type(operator TVMType()); return TVMType2Type(operator TVMType());
} }
inline TVMArgValue::operator Halide::Type() const { inline TVMArgValue::operator HalideIR::Type() const {
return TVMType2Type(operator TVMType()); return TVMType2Type(operator TVMType());
} }
inline void TVMArgsSetter::operator()( inline void TVMArgsSetter::operator()(
size_t i, const Halide::Type& t) const { size_t i, const HalideIR::Type& t) const {
this->operator()(i, Type2TVMType(t)); this->operator()(i, Type2TVMType(t));
} }
} // namespace runtime } // namespace runtime
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "./c_runtime_api.h" #include "./c_runtime_api.h"
#include "./module.h" #include "./module.h"
namespace Halide { namespace HalideIR {
// Forward declare type for extensions // Forward declare type for extensions
// The header works fine without depending on this. // The header works fine without depending on this.
struct Type; struct Type;
...@@ -351,8 +351,8 @@ class TVMArgValue : public TVMPODValue_ { ...@@ -351,8 +351,8 @@ class TVMArgValue : public TVMPODValue_ {
typename = typename std::enable_if< typename = typename std::enable_if<
std::is_class<TNodeRef>::value>::type> std::is_class<TNodeRef>::value>::type>
inline bool IsNodeType() const; inline bool IsNodeType() const;
inline operator Halide::Type() const; inline operator HalideIR::Type() const;
inline operator Halide::Expr() const; inline operator HalideIR::Expr() const;
// get internal node ptr, if it is node // get internal node ptr, if it is node
inline std::shared_ptr<Node>& node_sptr(); inline std::shared_ptr<Node>& node_sptr();
}; };
...@@ -531,8 +531,8 @@ class TVMRetValue : public TVMPODValue_ { ...@@ -531,8 +531,8 @@ class TVMRetValue : public TVMPODValue_ {
inline TVMRetValue& operator=(const NodeRef& other); inline TVMRetValue& operator=(const NodeRef& other);
inline TVMRetValue& operator=(const std::shared_ptr<Node>& other); inline TVMRetValue& operator=(const std::shared_ptr<Node>& other);
// type related // type related
inline operator Halide::Type() const; inline operator HalideIR::Type() const;
inline TVMRetValue& operator=(const Halide::Type& other); inline TVMRetValue& operator=(const HalideIR::Type& other);
private: private:
template<typename T> template<typename T>
...@@ -800,7 +800,7 @@ class TVMArgsSetter { ...@@ -800,7 +800,7 @@ class TVMArgsSetter {
inline void operator()(size_t i, const T& value) const; inline void operator()(size_t i, const T& value) const;
// NodeRef related extenstions: in tvm/packed_func_ext.h // NodeRef related extenstions: in tvm/packed_func_ext.h
inline void operator()(size_t i, const NodeRef& other) const; // NOLINT(*) inline void operator()(size_t i, const NodeRef& other) const; // NOLINT(*)
inline void operator()(size_t i, const Halide::Type& t) const; inline void operator()(size_t i, const HalideIR::Type& t) const;
private: private:
/*! \brief The values fields */ /*! \brief The values fields */
......
...@@ -23,7 +23,7 @@ class TensorNode; ...@@ -23,7 +23,7 @@ class TensorNode;
// internal node container for Operation // internal node container for Operation
class OperationNode; class OperationNode;
using Halide::IR::FunctionRef; using HalideIR::IR::FunctionRef;
/*! /*!
* \brief Tensor structure representing a possible input, * \brief Tensor structure representing a possible input,
......
...@@ -27,7 +27,7 @@ TVM_REGISTER_API("make.For") ...@@ -27,7 +27,7 @@ TVM_REGISTER_API("make.For")
args[1], args[1],
args[2], args[2],
static_cast<ForType>(args[3].operator int()), static_cast<ForType>(args[3].operator int()),
static_cast<Halide::DeviceAPI>(args[4].operator int()), static_cast<HalideIR::DeviceAPI>(args[4].operator int()),
args[5]); args[5]);
}); });
......
...@@ -16,7 +16,7 @@ namespace tvm { ...@@ -16,7 +16,7 @@ namespace tvm {
namespace arith { namespace arith {
using namespace ir; using namespace ir;
using Halide::Internal::Interval; using HalideIR::Internal::Interval;
// a visitor to find the path to the target variable // a visitor to find the path to the target variable
// from a expression. // from a expression.
......
...@@ -626,7 +626,7 @@ Expr CanonicalSimplify(Expr expr, Map<Var, Range> vrange) { ...@@ -626,7 +626,7 @@ Expr CanonicalSimplify(Expr expr, Map<Var, Range> vrange) {
template<typename T> template<typename T>
T Simplify_(T a, Map<Var, Range> vrange) { T Simplify_(T a, Map<Var, Range> vrange) {
using namespace Halide::Internal; using namespace HalideIR::Internal;
Scope<Interval> rscope; Scope<Interval> rscope;
for (auto kv : vrange) { for (auto kv : vrange) {
Range r = kv.second; Range r = kv.second;
...@@ -635,7 +635,7 @@ T Simplify_(T a, Map<Var, Range> vrange) { ...@@ -635,7 +635,7 @@ T Simplify_(T a, Map<Var, Range> vrange) {
Interval(r->min, Interval(r->min,
simplify(r->min + r->extent - make_const(r->min.type(), 1)))); simplify(r->min + r->extent - make_const(r->min.type(), 1))));
} }
return Halide::Internal::simplify(a, true, rscope); return HalideIR::Internal::simplify(a, true, rscope);
} }
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
namespace tvm { namespace tvm {
namespace arith { namespace arith {
using Halide::Internal::add_would_overflow; using HalideIR::Internal::add_would_overflow;
using Halide::Internal::sub_would_overflow; using HalideIR::Internal::sub_would_overflow;
using Halide::Internal::mul_would_overflow; using HalideIR::Internal::mul_would_overflow;
/*! /*!
* \brief Compute the expression with the given binary op. * \brief Compute the expression with the given binary op.
...@@ -133,12 +133,12 @@ inline Expr ComputeExpr<ir::Mod>(Expr a, Expr b) { ...@@ -133,12 +133,12 @@ inline Expr ComputeExpr<ir::Mod>(Expr a, Expr b) {
template<> template<>
inline Expr ComputeExpr<ir::Max>(Expr a, Expr b) { inline Expr ComputeExpr<ir::Max>(Expr a, Expr b) {
return Halide::Internal::Interval::make_max(a, b); return HalideIR::Internal::Interval::make_max(a, b);
} }
template<> template<>
inline Expr ComputeExpr<ir::Min>(Expr a, Expr b) { inline Expr ComputeExpr<ir::Min>(Expr a, Expr b) {
return Halide::Internal::Interval::make_min(a, b); return HalideIR::Internal::Interval::make_min(a, b);
} }
template<typename Op> template<typename Op>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
namespace tvm { namespace tvm {
namespace arith { namespace arith {
using Halide::Internal::Interval; using HalideIR::Internal::Interval;
using namespace ir; using namespace ir;
inline IntSet IntSet::cover_interval() const { inline IntSet IntSet::cover_interval() const {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
namespace tvm { namespace tvm {
namespace arith { namespace arith {
using Halide::Internal::Interval; using HalideIR::Internal::Interval;
/*! \brief Set of continuous interval */ /*! \brief Set of continuous interval */
struct IntervalSet : public IntSetNode { struct IntervalSet : public IntSetNode {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
namespace tvm { namespace tvm {
using Halide::IR::RangeNode; using HalideIR::IR::RangeNode;
Range::Range(Expr begin, Expr end) Range::Range(Expr begin, Expr end)
: Range(std::make_shared<RangeNode>( : Range(std::make_shared<RangeNode>(
...@@ -19,7 +19,7 @@ Range::Range(Expr begin, Expr end) ...@@ -19,7 +19,7 @@ Range::Range(Expr begin, Expr end)
} }
Range Range::make_by_min_extent(Expr min, Expr extent) { Range Range::make_by_min_extent(Expr min, Expr extent) {
return Range(std::make_shared<Halide::IR::RangeNode>(min, extent)); return Range(std::make_shared<HalideIR::IR::RangeNode>(min, extent));
} }
IterVar IterVarNode::make(Range dom, Var var, IterVar IterVarNode::make(Range dom, Var var,
...@@ -67,7 +67,7 @@ TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable) ...@@ -67,7 +67,7 @@ TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable)
}); });
TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable) TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable)
.set_dispatch<RangeNode>([](const Halide::IR::RangeNode *op, IRPrinter *p) { .set_dispatch<RangeNode>([](const HalideIR::IR::RangeNode *op, IRPrinter *p) {
p->stream << "range(min=" << op->min << ", ext=" << op->extent << ')'; p->stream << "range(min=" << op->min << ", ext=" << op->extent << ')';
}); });
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <memory> #include <memory>
#include "../pass/ir_util.h" #include "../pass/ir_util.h"
namespace Halide { namespace HalideIR {
namespace Internal { namespace Internal {
using tvm::ir::CommReducerNode; using tvm::ir::CommReducerNode;
...@@ -43,7 +43,7 @@ TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable) ...@@ -43,7 +43,7 @@ TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable)
<< ")"; << ")";
}); });
} // namespace Internal } // namespace Internal
} // namespace Halide } // namespace HalideIR
namespace tvm { namespace tvm {
namespace ir { namespace ir {
......
...@@ -25,7 +25,7 @@ inline std::string Type2String(const Type& t) { ...@@ -25,7 +25,7 @@ inline std::string Type2String(const Type& t) {
inline Type String2Type(std::string s) { inline Type String2Type(std::string s) {
std::istringstream is(s); std::istringstream is(s);
halide_type_code_t code = Type::Int; halideir_type_code_t code = Type::Int;
if (s.substr(0, 3) == "int") { if (s.substr(0, 3) == "int") {
code = Type::Int; s = s.substr(3); code = Type::Int; s = s.substr(3);
} else if (s.substr(0, 4) == "uint") { } else if (s.substr(0, 4) == "uint") {
......
...@@ -16,7 +16,7 @@ Expr Tensor::operator()(Array<Var> indices) const { ...@@ -16,7 +16,7 @@ Expr Tensor::operator()(Array<Var> indices) const {
} }
Expr Tensor::operator()(Array<Expr> indices) const { Expr Tensor::operator()(Array<Expr> indices) const {
using Halide::Internal::Call; using HalideIR::Internal::Call;
CHECK_EQ(ndim(), indices.size()) CHECK_EQ(ndim(), indices.size())
<< "Tensor dimension mismatch in read" << "Tensor dimension mismatch in read"
<< "ndim = " << ndim() << ", indices.size=" << indices.size(); << "ndim = " << ndim() << ", indices.size=" << indices.size();
......
...@@ -228,7 +228,7 @@ Stmt ComputeOpNode::BuildRealize( ...@@ -228,7 +228,7 @@ Stmt ComputeOpNode::BuildRealize(
const std::unordered_map<IterVar, Range>& realize_map, const std::unordered_map<IterVar, Range>& realize_map,
const Stmt& realize_body) const { const Stmt& realize_body) const {
CHECK_EQ(stage->op.get(), this); CHECK_EQ(stage->op.get(), this);
Halide::Internal::Region bounds; HalideIR::Internal::Region bounds;
for (IterVar iv : this->axis) { for (IterVar iv : this->axis) {
bounds.push_back(realize_map.at(iv)); bounds.push_back(realize_map.at(iv));
} }
......
...@@ -113,7 +113,7 @@ Stmt ExternOpNode::BuildRealize( ...@@ -113,7 +113,7 @@ Stmt ExternOpNode::BuildRealize(
Stmt realize_body = body; Stmt realize_body = body;
for (int k = 0; k < num_outputs(); ++k) { for (int k = 0; k < num_outputs(); ++k) {
Tensor t = stage->op.output(k); Tensor t = stage->op.output(k);
Halide::Internal::Region bounds; HalideIR::Internal::Region bounds;
for (size_t i = 0; i < t->shape.size(); ++i) { for (size_t i = 0; i < t->shape.size(); ++i) {
bounds.push_back( bounds.push_back(
Range::make_by_min_extent( Range::make_by_min_extent(
......
...@@ -238,7 +238,7 @@ Stmt ScanOpNode::BuildRealize( ...@@ -238,7 +238,7 @@ Stmt ScanOpNode::BuildRealize(
for (size_t i = 0; i < update.size(); ++i) { for (size_t i = 0; i < update.size(); ++i) {
Tensor t = stage->op.output(i); Tensor t = stage->op.output(i);
CHECK_EQ(static_cast<size_t>(t->value_index), i); CHECK_EQ(static_cast<size_t>(t->value_index), i);
Halide::Internal::Region bounds; HalideIR::Internal::Region bounds;
bounds.push_back(tdom); bounds.push_back(tdom);
for (size_t k = 1; k < this->update[i]->shape.size(); ++k, ++sp_idx) { for (size_t k = 1; k < this->update[i]->shape.size(); ++k, ++sp_idx) {
IterVar sp_ax = this->spatial_axis_[sp_idx]; IterVar sp_ax = this->spatial_axis_[sp_idx];
......
...@@ -15,7 +15,7 @@ namespace ir { ...@@ -15,7 +15,7 @@ namespace ir {
using arith::IntSet; using arith::IntSet;
using arith::DomainTouched; using arith::DomainTouched;
using Halide::Internal::Region; using HalideIR::Internal::Region;
class PrefetchInjector : public IRMutator { class PrefetchInjector : public IRMutator {
public: public:
......
...@@ -328,8 +328,8 @@ class IRDeepCompare : ...@@ -328,8 +328,8 @@ class IRDeepCompare :
return order_; return order_;
} }
int CompareRegion(const Halide::Internal::Region& lhs, int CompareRegion(const HalideIR::Internal::Region& lhs,
const Halide::Internal::Region& rhs) { const HalideIR::Internal::Region& rhs) {
if (order_ != 0) return order_; if (order_ != 0) return order_;
if (CompareValue(lhs.size(), rhs.size()) != 0) return order_; if (CompareValue(lhs.size(), rhs.size()) != 0) return order_;
for (size_t i = 0; i < lhs.size(); ++i) { for (size_t i = 0; i < lhs.size(); ++i) {
......
...@@ -206,7 +206,7 @@ Stmt IRMutator::Mutate_(const Provide* op, const Stmt& s) { ...@@ -206,7 +206,7 @@ Stmt IRMutator::Mutate_(const Provide* op, const Stmt& s) {
Stmt IRMutator::Mutate_(const Realize* op, const Stmt& s) { Stmt IRMutator::Mutate_(const Realize* op, const Stmt& s) {
IRMutator* m = this; IRMutator* m = this;
Halide::Internal::Region new_bounds; HalideIR::Internal::Region new_bounds;
bool bounds_changed = false; bool bounds_changed = false;
// Mutate the bounds // Mutate the bounds
...@@ -236,7 +236,7 @@ Stmt IRMutator::Mutate_(const Realize* op, const Stmt& s) { ...@@ -236,7 +236,7 @@ Stmt IRMutator::Mutate_(const Realize* op, const Stmt& s) {
Stmt IRMutator::Mutate_(const Prefetch* op, const Stmt& s) { Stmt IRMutator::Mutate_(const Prefetch* op, const Stmt& s) {
IRMutator* m = this; IRMutator* m = this;
Halide::Internal::Region new_bounds; HalideIR::Internal::Region new_bounds;
bool bounds_changed = false; bool bounds_changed = false;
// Mutate the bounds // Mutate the bounds
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
namespace tvm { namespace tvm {
namespace ir { namespace ir {
using Halide::Internal::Region; using HalideIR::Internal::Region;
using runtime::StorageScope; using runtime::StorageScope;
using runtime::ThreadScope; using runtime::ThreadScope;
using intrinsic::tvm_address_of; using intrinsic::tvm_address_of;
......
...@@ -407,7 +407,7 @@ void PassUpBoundCheck(const Stage& s, ...@@ -407,7 +407,7 @@ void PassUpBoundCheck(const Stage& s,
const Map<IterVar, Range>& dom_map, const Map<IterVar, Range>& dom_map,
std::unordered_map<IterVar, bool>* p_state) { std::unordered_map<IterVar, bool>* p_state) {
auto& state = *p_state; auto& state = *p_state;
using Halide::Internal::can_prove; using HalideIR::Internal::can_prove;
for (size_t i = s->relations.size(); i != 0; --i) { for (size_t i = s->relations.size(); i != 0; --i) {
IterVarRelation rel = s->relations[i - 1]; IterVarRelation rel = s->relations[i - 1];
if (rel.as<SplitNode>()) { if (rel.as<SplitNode>()) {
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
namespace { namespace {
using namespace tvm::ir; using namespace tvm::ir;
using namespace Halide::Internal; using namespace HalideIR::Internal;
using namespace Halide; using namespace HalideIR;
// replace variable to constant // replace variable to constant
class IRVar2Const : public IRMutator { class IRVar2Const : public IRMutator {
...@@ -38,7 +38,7 @@ TVM_STATIC_IR_FUNCTOR(IRVar2Const, vtable_expr) ...@@ -38,7 +38,7 @@ TVM_STATIC_IR_FUNCTOR(IRVar2Const, vtable_expr)
} // namespace } // namespace
TEST(IRMutator, Basic) { TEST(IRMutator, Basic) {
using namespace Halide::Internal; using namespace HalideIR::Internal;
using namespace tvm; using namespace tvm;
Var x("x"), y; Var x("x"), y;
auto z = x + y; auto z = x + y;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <arithmetic/Simplify.h> #include <arithmetic/Simplify.h>
TEST(IRSIMPLIFY, Basic) { TEST(IRSIMPLIFY, Basic) {
using namespace Halide::Internal; using namespace HalideIR::Internal;
simplify_test(); simplify_test();
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
TEST(IRSSA, Convert) { TEST(IRSSA, Convert) {
using namespace Halide::Internal; using namespace HalideIR::Internal;
using namespace tvm; using namespace tvm;
Var x("x"), y; Var x("x"), y;
Expr let = Let::make(x, 1, x + 1); Expr let = Let::make(x, 1, x + 1);
...@@ -17,7 +17,7 @@ TEST(IRSSA, Convert) { ...@@ -17,7 +17,7 @@ TEST(IRSSA, Convert) {
} }
TEST(IRSSA, Basic) { TEST(IRSSA, Basic) {
using namespace Halide::Internal; using namespace HalideIR::Internal;
using namespace tvm; using namespace tvm;
Var x("x"), y; Var x("x"), y;
auto z = Evaluate::make(x + y); auto z = Evaluate::make(x + y);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <tvm/ir_pass.h> #include <tvm/ir_pass.h>
TEST(IRVisitor, CountVar) { TEST(IRVisitor, CountVar) {
using namespace Halide::Internal; using namespace HalideIR::Internal;
using namespace tvm; using namespace tvm;
int n_var = 0; int n_var = 0;
Var x("x"), y; Var x("x"), y;
......
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