Skip to content

Commit

Permalink
Fix Sanity Check
Browse files Browse the repository at this point in the history
  • Loading branch information
cchung100m committed May 17, 2020
1 parent 0b1b30b commit 25d7806
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 16 deletions.
5 changes: 2 additions & 3 deletions include/tvm/tir/data_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class Layout : public ObjectRef {
explicit Layout(const Array<tir::IterVar>& axes);

/*! \brief construct from a string */
Layout(const char* name) : Layout(String(name)) {} // NOLINT(*)
Layout(const char* name) : Layout(String(name)) {} // NOLINT(*)
Layout(const std::string& name) : Layout(String(name)) {} // NOLINT(*)

/*!
Expand Down Expand Up @@ -211,8 +211,7 @@ class Layout : public ObjectRef {
for (auto dst_axis : dst_layout->axes) {
if (LayoutAxis::Get(dst_axis).IsPrimal()) {
if (!this->Contains(LayoutAxis::Get(dst_axis))) {
new_src_layout_str.operator std::string() +=
dst_axis->var->name_hint.operator std::string();
new_src_layout_str.operator std::string() += dst_axis->var->name_hint.c_str();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions include/tvm/tir/var.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ class IterVarNode : public Object {
hash_reduce(thread_tag);
}

TVM_DLL static IterVar make(Range dom, Var var, IterVarType iter_type,
String thread_tag = "");
TVM_DLL static IterVar make(Range dom, Var var, IterVarType iter_type, String thread_tag = "");

static constexpr const char* _type_key = "IterVar";
static constexpr const bool _type_has_method_sequal_reduce = true;
Expand Down
4 changes: 2 additions & 2 deletions src/target/llvm/codegen_cpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ llvm::Value* CodeGenCPU::CreateCallExtern(const CallNode* op) {
} else {
llvm::Function* f = module_->getFunction(op->name.operator std::string());
if (f == nullptr) {
f = llvm::Function::Create(ftype, llvm::Function::ExternalLinkage,
op->name.operator std::string(), module_.get());
f = llvm::Function::Create(
ftype, llvm::Function::ExternalLinkage, op->name.operator std::string(), module_.get());
}
#if TVM_LLVM_VERSION >= 90
auto ext_callee = llvm::FunctionCallee(f);
Expand Down
4 changes: 2 additions & 2 deletions src/target/llvm/codegen_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,8 @@ llvm::Value* CodeGenLLVM::CreateCallExtern(const CallNode* op) {
llvm::FunctionType::get(GetLLVMType(GetRef<PrimExpr>(op)), arg_type, false);
llvm::Function* f = module_->getFunction(op->name.operator std::string());
if (f == nullptr) {
f = llvm::Function::Create(ftype, llvm::Function::ExternalLinkage,
op->name.operator std::string(), module_.get());
f = llvm::Function::Create(
ftype, llvm::Function::ExternalLinkage, op->name.operator std::string(), module_.get());
}
llvm::CallInst* call = builder_->CreateCall(f, arg_value);
return call;
Expand Down
4 changes: 2 additions & 2 deletions src/tir/ir/buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ PrimExpr Buffer::access_ptr(int access_mask, DataType ptr_type, int content_lane
}

Buffer BufferNode::make(Var data, DataType dtype, Array<PrimExpr> shape, Array<PrimExpr> strides,
PrimExpr elem_offset, String name, String scope,
int data_alignment, int offset_factor, BufferType buffer_type) {
PrimExpr elem_offset, String name, String scope,int data_alignment,
int offset_factor, BufferType buffer_type) {
auto n = make_object<BufferNode>();
n->data = std::move(data);
n->dtype = dtype;
Expand Down
6 changes: 3 additions & 3 deletions src/tir/ir/data_layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ TVM_REGISTER_GLOBAL("tir.LayoutIndexOf").set_body_typed([](Layout layout, String
});

TVM_REGISTER_GLOBAL("tir.LayoutFactorOf")
.set_body_typed([](Layout layout, String axis) -> int {
return layout.FactorOf(LayoutAxis::make(axis));
});
.set_body_typed([](Layout layout, String axis) -> int {
return layout.FactorOf(LayoutAxis::make(axis));
});

TVM_REGISTER_GLOBAL("tir.LayoutNdim").set_body_typed([](Layout layout) -> int {
return layout.ndim();
Expand Down
3 changes: 1 addition & 2 deletions src/tir/transforms/inject_copy_intrin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ class CopyIntrinInjector : public StmtMutator {
arith::Analyzer analyzer_;
};

Stmt InjectCopyIntrin(Stmt stmt, const String& pragma_key,
const PackedFunc& flower_copy_fromto) {
Stmt InjectCopyIntrin(Stmt stmt, const String& pragma_key, const PackedFunc& flower_copy_fromto) {
return CopyIntrinInjector(pragma_key, flower_copy_fromto)(std::move(stmt));
}

Expand Down

0 comments on commit 25d7806

Please sign in to comment.