From 5e40764570c5be7da994d488f8d3be41dd205039 Mon Sep 17 00:00:00 2001 From: Kimish Patel Date: Mon, 23 Sep 2019 16:45:11 -0700 Subject: [PATCH] Added ASF header + define macro for the header file: TVM_ARITHMETIC_IR_VISITOR_WITH_ANALYZER_H_ Some lint fixes as well. --- src/arithmetic/ir_visitor_with_analyzer.h | 28 +++++++++++++++++++++++ src/pass/storage_flatten.cc | 6 ++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/arithmetic/ir_visitor_with_analyzer.h b/src/arithmetic/ir_visitor_with_analyzer.h index 63394fbf5a9c..71eea50e4c72 100644 --- a/src/arithmetic/ir_visitor_with_analyzer.h +++ b/src/arithmetic/ir_visitor_with_analyzer.h @@ -1,3 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/*! + * \file tvm/arithmetic/ir_visitor_with_analyzer.h + * \brief IR visitor class with an analyzer context. + */ + +#ifndef TVM_ARITHMETIC_IR_VISITOR_WITH_ANALYZER_H_ +#define TVM_ARITHMETIC_IR_VISITOR_WITH_ANALYZER_H_ + #include #include #include @@ -46,3 +73,4 @@ class IRVisitorWithAnalyzer final : public IRVisitor { } // namespace ir } // namespace tvm +#endif // TVM_ARITHMETIC_IR_VISITOR_WITH_ANALYZER_H_ diff --git a/src/pass/storage_flatten.cc b/src/pass/storage_flatten.cc index 54ed20eccd6f..1bf661d51e2a 100644 --- a/src/pass/storage_flatten.cc +++ b/src/pass/storage_flatten.cc @@ -54,8 +54,8 @@ class StorageFlattener : public IRMutator { explicit StorageFlattener(Map extern_buffer, int cache_line_size, bool create_bound_attributes, const std::shared_ptr& bounded_analyzer) - : create_bound_attributes_(create_bound_attributes), - bounded_analyzer_(bounded_analyzer) { + : bounded_analyzer_(bounded_analyzer), + create_bound_attributes_(create_bound_attributes) { for (auto kv : extern_buffer) { BufferEntry e; e.buffer = kv.second; @@ -537,7 +537,7 @@ Stmt StorageFlatten(Stmt stmt, Map extern_buffer, * or moves data. Perhaps we should disable copy operator and implement * move operator. */ - std::shared_ptr bounded_analyzer= + std::shared_ptr bounded_analyzer = std::make_shared(); bounded_analyzer->Visit(stmt); stmt =