From fa098cde5f8d495f95a9e92438460d9d98e794e4 Mon Sep 17 00:00:00 2001 From: driazati Date: Thu, 7 Apr 2022 15:26:00 -0700 Subject: [PATCH] format files --- .../template_project/src/host_driven/main.c | 1 - include/tvm/relay/attrs/annotation.h | 1 - src/ir/transform.cc | 1 - src/relay/op/tensor/unary.cc | 1 - src/relay/qnn/op/convolution_transpose.cc | 2 +- src/relay/qnn/op/dense.cc | 4 +- src/runtime/hexagon/hexagon/hexagon_common.cc | 1 - src/target/source/codegen_c.h | 56 +++++++++---------- src/te/schedule/schedule_ops.cc | 2 +- src/tir/transforms/make_unpacked_api.cc | 1 - .../transforms/tensorcore_infer_fragment.cc | 4 +- 11 files changed, 33 insertions(+), 41 deletions(-) diff --git a/apps/microtvm/zephyr/template_project/src/host_driven/main.c b/apps/microtvm/zephyr/template_project/src/host_driven/main.c index 44d656028cbc..61dc66efc308 100644 --- a/apps/microtvm/zephyr/template_project/src/host_driven/main.c +++ b/apps/microtvm/zephyr/template_project/src/host_driven/main.c @@ -260,7 +260,6 @@ void uart_rx_init(struct ring_buf* rbuf, const struct device* dev) { // The main function of this application. extern void __stdout_hook_install(int (*hook)(int)); void main(void) { - #ifdef CONFIG_LED int ret; led0_pin = device_get_binding(LED0); diff --git a/include/tvm/relay/attrs/annotation.h b/include/tvm/relay/attrs/annotation.h index 79889ce9a790..1066416838b5 100644 --- a/include/tvm/relay/attrs/annotation.h +++ b/include/tvm/relay/attrs/annotation.h @@ -54,7 +54,6 @@ struct CompilerAttrs : public tvm::AttrsNode { } }; - } // namespace relay } // namespace tvm #endif // TVM_RELAY_ATTRS_ANNOTATION_H_ diff --git a/src/ir/transform.cc b/src/ir/transform.cc index 53c24bdf0adf..dfd307d715ae 100644 --- a/src/ir/transform.cc +++ b/src/ir/transform.cc @@ -318,7 +318,6 @@ class ModulePass : public Pass { TVM_DEFINE_OBJECT_REF_METHODS(ModulePass, Pass, ModulePassNode); }; - PassInfo::PassInfo(int opt_level, String name, tvm::Array required) { auto pass_info = make_object(); pass_info->opt_level = opt_level; diff --git a/src/relay/op/tensor/unary.cc b/src/relay/op/tensor/unary.cc index 938efe230a40..c6d149846e56 100644 --- a/src/relay/op/tensor/unary.cc +++ b/src/relay/op/tensor/unary.cc @@ -419,7 +419,6 @@ RELAY_REGISTER_UNARY_OP("bitwise_not") .set_support_level(4) .set_attr("FTVMCompute", RELAY_UNARY_COMPUTE(topi::bitwise_not)); - Array ShapeOfCompute(const Attrs& attrs, const Array& inputs, const Type& out_type) { ICHECK_EQ(inputs.size(), 1); diff --git a/src/relay/qnn/op/convolution_transpose.cc b/src/relay/qnn/op/convolution_transpose.cc index 2b4ec4fd5d56..9710d1fd7ae5 100644 --- a/src/relay/qnn/op/convolution_transpose.cc +++ b/src/relay/qnn/op/convolution_transpose.cc @@ -107,7 +107,7 @@ bool QnnConv2DTransposeRel(const Array& types, int num_inputs, const Attrs return false; } } - ICHECK(IsScalarType(types[2], DataType::Int(32))); // input_zero_point + ICHECK(IsScalarType(types[2], DataType::Int(32))); // input_zero_point const auto* weight_zp_type = types[3].as(); ICHECK(weight_zp_type->dtype == DataType::Int(32)); // weight_zero_point diff --git a/src/relay/qnn/op/dense.cc b/src/relay/qnn/op/dense.cc index 7b733d4777ec..adaf509e7daf 100644 --- a/src/relay/qnn/op/dense.cc +++ b/src/relay/qnn/op/dense.cc @@ -60,8 +60,8 @@ bool QnnDenseRel(const Array& types, int num_inputs, const Attrs& attrs, return false; } } - ICHECK(IsScalarType(types[2], DataType::Int(32))); // input_zero_point - ICHECK(IsScalarType(types[4], DataType::Float(32))); // input_scale + ICHECK(IsScalarType(types[2], DataType::Int(32))); // input_zero_point + ICHECK(IsScalarType(types[4], DataType::Float(32))); // input_scale // weight_zero_point can be a scalar or a vector of the same shape as the weight_scale AssignType(types[5], DataType::Float(32), param->units, reporter); // weight_scale diff --git a/src/runtime/hexagon/hexagon/hexagon_common.cc b/src/runtime/hexagon/hexagon/hexagon_common.cc index 9aee341d64b8..f7bd4ffda7aa 100644 --- a/src/runtime/hexagon/hexagon/hexagon_common.cc +++ b/src/runtime/hexagon/hexagon/hexagon_common.cc @@ -47,7 +47,6 @@ namespace tvm { namespace runtime { namespace hexagon { - #if defined(__hexagon__) class HexagonTimerNode : public TimerNode { public: diff --git a/src/target/source/codegen_c.h b/src/target/source/codegen_c.h index 4f671950260e..696ec62c5870 100644 --- a/src/target/source/codegen_c.h +++ b/src/target/source/codegen_c.h @@ -124,35 +124,35 @@ class CodeGenC : public ExprFunctor, */ virtual void InitFuncState(const PrimFunc& f); // expression - void VisitExpr_(const VarNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const LoadNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const VarNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const LoadNode* op, std::ostream& os) override; // NOLINT(*) void VisitExpr_(const BufferLoadNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const LetNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const CallNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const AddNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const SubNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const MulNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const DivNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const ModNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const MinNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const MaxNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const EQNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const NENode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const LTNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const LENode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const GTNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const GENode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const AndNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const OrNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const CastNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const NotNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const SelectNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const RampNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const ShuffleNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const BroadcastNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const IntImmNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const FloatImmNode* op, std::ostream& os) override; // NOLINT(*) - void VisitExpr_(const StringImmNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const LetNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const CallNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const AddNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const SubNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const MulNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const DivNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const ModNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const MinNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const MaxNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const EQNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const NENode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const LTNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const LENode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const GTNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const GENode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const AndNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const OrNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const CastNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const NotNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const SelectNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const RampNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const ShuffleNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const BroadcastNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const IntImmNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const FloatImmNode* op, std::ostream& os) override; // NOLINT(*) + void VisitExpr_(const StringImmNode* op, std::ostream& os) override; // NOLINT(*) // statment void VisitStmt_(const LetStmtNode* op) override; void VisitStmt_(const StoreNode* op) override; diff --git a/src/te/schedule/schedule_ops.cc b/src/te/schedule/schedule_ops.cc index 75736d0333da..d9818309c2d6 100644 --- a/src/te/schedule/schedule_ops.cc +++ b/src/te/schedule/schedule_ops.cc @@ -211,7 +211,7 @@ class SchedulePostProc : public StmtExprMutator { } } } else if (op->attr_key == tir::attr::buffer_bind_scope) { - Array tuple = Downcast >(op->node); + Array tuple = Downcast>(op->node); Tensor tensor = Downcast(tuple[1]); auto it = replace_op_.find(tensor->op.get()); if (it != replace_op_.end()) { diff --git a/src/tir/transforms/make_unpacked_api.cc b/src/tir/transforms/make_unpacked_api.cc index fc43e1449d6a..c57daeabbe1d 100644 --- a/src/tir/transforms/make_unpacked_api.cc +++ b/src/tir/transforms/make_unpacked_api.cc @@ -57,7 +57,6 @@ PrimFunc MakeUnpackedAPI(PrimFunc&& func) { const Stmt nop = Evaluate(0); std::vector device_init; - // Collect variables and buffers to map between Array args; Map new_buffer_map; diff --git a/src/tir/transforms/tensorcore_infer_fragment.cc b/src/tir/transforms/tensorcore_infer_fragment.cc index 89b9307198f6..b05019307646 100644 --- a/src/tir/transforms/tensorcore_infer_fragment.cc +++ b/src/tir/transforms/tensorcore_infer_fragment.cc @@ -107,9 +107,7 @@ class FragmentGetter : public StmtExprVisitor { } // Get memory scope - void VisitStmt_(const AttrStmtNode* op) final { - StmtExprVisitor::VisitStmt_(op); - } + void VisitStmt_(const AttrStmtNode* op) final { StmtExprVisitor::VisitStmt_(op); } // Fragment metadata for all fragments std::unordered_map fragments;