From fb151914339470c75c4c89ac2888274b20c922fa Mon Sep 17 00:00:00 2001 From: cyberslack_lee Date: Tue, 4 Jul 2023 08:54:38 +0800 Subject: [PATCH] [CodeStyle][CINN] fix cpplint codestyle `[build/include_order]` `[build/header_guard]` `[build/include_subdir]` `[build/include]` (#55085) * fix cpplint * fix * part 1, [build/include_order] * Revert "part 1, [build/include_order]" This reverts commit 5d7f969948a080ab1bdf6dc4692aa2c380dcee92. * skip, [build/include_order] --------- Co-authored-by: SigureMo --- paddle/cinn/backends/nvrtc/header_generator.cc | 2 +- paddle/cinn/common/target.cc | 5 ----- paddle/cinn/common/type.cc | 2 -- paddle/cinn/frontend/computation.h | 1 + paddle/cinn/frontend/pass/pass_test_helper.h | 2 ++ paddle/cinn/frontend/pass/transpose_folding_base.h | 2 ++ paddle/cinn/hlir/op/contrib/logical_right_shift.cc | 1 + paddle/cinn/hlir/op/contrib/reciprocal.cc | 1 + paddle/cinn/hlir/op/custom_call.cc | 2 +- paddle/cinn/hlir/op/transform.cc | 1 - paddle/cinn/hlir/pass/infershape.h | 2 ++ paddle/cinn/poly/domain_add_unit_loop_mutator.h | 2 ++ paddle/cinn/runtime/cpu/mkldnn_math.h | 2 +- paddle/cinn/runtime/cuda/test_util.h | 1 + paddle/cinn/runtime/tiny_runtime.cc | 2 +- 15 files changed, 16 insertions(+), 12 deletions(-) diff --git a/paddle/cinn/backends/nvrtc/header_generator.cc b/paddle/cinn/backends/nvrtc/header_generator.cc index 328b0ce1f53..d4b2b950467 100644 --- a/paddle/cinn/backends/nvrtc/header_generator.cc +++ b/paddle/cinn/backends/nvrtc/header_generator.cc @@ -15,7 +15,7 @@ #include "paddle/cinn/backends/nvrtc/header_generator.h" #include "glog/logging.h" -#include "jitify.hpp" +#include "jitify.hpp" // NOLINT namespace cinn { namespace backends { diff --git a/paddle/cinn/common/target.cc b/paddle/cinn/common/target.cc index 42a130163a1..95d57c3172a 100644 --- a/paddle/cinn/common/target.cc +++ b/paddle/cinn/common/target.cc @@ -23,11 +23,6 @@ #include "paddle/cinn/common/target.h" #include "paddle/cinn/runtime/cinn_runtime.h" -#ifdef CINN_WITH_CUDA -#include -#include -#endif - namespace cinn { namespace common { diff --git a/paddle/cinn/common/type.cc b/paddle/cinn/common/type.cc index ad5c8412d95..2b155757081 100644 --- a/paddle/cinn/common/type.cc +++ b/paddle/cinn/common/type.cc @@ -19,8 +19,6 @@ #include #include -#include "type.h" - namespace cinn { namespace common { diff --git a/paddle/cinn/frontend/computation.h b/paddle/cinn/frontend/computation.h index c464cb40d2a..8b16f948332 100644 --- a/paddle/cinn/frontend/computation.h +++ b/paddle/cinn/frontend/computation.h @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#pragma once #include #include "paddle/cinn/frontend/net_builder.h" diff --git a/paddle/cinn/frontend/pass/pass_test_helper.h b/paddle/cinn/frontend/pass/pass_test_helper.h index e56746a8636..cf1b8c201d8 100644 --- a/paddle/cinn/frontend/pass/pass_test_helper.h +++ b/paddle/cinn/frontend/pass/pass_test_helper.h @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#pragma once + #include #include diff --git a/paddle/cinn/frontend/pass/transpose_folding_base.h b/paddle/cinn/frontend/pass/transpose_folding_base.h index fbcb384b170..4acc8e4f6d1 100644 --- a/paddle/cinn/frontend/pass/transpose_folding_base.h +++ b/paddle/cinn/frontend/pass/transpose_folding_base.h @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#pragma once + #include #include diff --git a/paddle/cinn/hlir/op/contrib/logical_right_shift.cc b/paddle/cinn/hlir/op/contrib/logical_right_shift.cc index 68f117aad49..1f16d2195c6 100644 --- a/paddle/cinn/hlir/op/contrib/logical_right_shift.cc +++ b/paddle/cinn/hlir/op/contrib/logical_right_shift.cc @@ -26,6 +26,7 @@ #include "paddle/cinn/hlir/framework/node.h" #include "paddle/cinn/hlir/framework/op.h" #include "paddle/cinn/hlir/framework/op_strategy.h" +#include "paddle/cinn/hlir/op/contrib/logical_right_shift.h" #include "paddle/cinn/hlir/op/op_util.h" #include "paddle/cinn/hlir/pe/ir_schedule_pe.h" #include "paddle/cinn/hlir/pe/nn.h" diff --git a/paddle/cinn/hlir/op/contrib/reciprocal.cc b/paddle/cinn/hlir/op/contrib/reciprocal.cc index 09d180601ac..50fbba76234 100644 --- a/paddle/cinn/hlir/op/contrib/reciprocal.cc +++ b/paddle/cinn/hlir/op/contrib/reciprocal.cc @@ -26,6 +26,7 @@ #include "paddle/cinn/hlir/framework/node.h" #include "paddle/cinn/hlir/framework/op.h" #include "paddle/cinn/hlir/framework/op_strategy.h" +#include "paddle/cinn/hlir/op/contrib/reciprocal.h" #include "paddle/cinn/hlir/op/op_util.h" #include "paddle/cinn/hlir/pe/ir_schedule_pe.h" #include "paddle/cinn/hlir/pe/nn.h" diff --git a/paddle/cinn/hlir/op/custom_call.cc b/paddle/cinn/hlir/op/custom_call.cc index c109df2ec28..5f272b98c22 100644 --- a/paddle/cinn/hlir/op/custom_call.cc +++ b/paddle/cinn/hlir/op/custom_call.cc @@ -27,7 +27,7 @@ #include "paddle/cinn/utils/string.h" #ifdef CINN_WITH_CUDNN -#include "cudnn.h" +#include #endif namespace cinn { diff --git a/paddle/cinn/hlir/op/transform.cc b/paddle/cinn/hlir/op/transform.cc index 1f362dc76fc..78d24cba703 100644 --- a/paddle/cinn/hlir/op/transform.cc +++ b/paddle/cinn/hlir/op/transform.cc @@ -25,7 +25,6 @@ #include "paddle/cinn/hlir/pe/ir_schedule_pe.h" #include "paddle/cinn/hlir/pe/nn.h" #include "paddle/cinn/hlir/pe/schedule.h" -#include "paddle/cinn/hlir/pe/transform.h" #include "paddle/cinn/ir/ir_printer.h" #include "paddle/cinn/utils/string.h" diff --git a/paddle/cinn/hlir/pass/infershape.h b/paddle/cinn/hlir/pass/infershape.h index a9b9c8a528e..7ed0ca5fe78 100644 --- a/paddle/cinn/hlir/pass/infershape.h +++ b/paddle/cinn/hlir/pass/infershape.h @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#pragma once + #include "paddle/cinn/common/graph_utils.h" #include "paddle/cinn/hlir/framework/graph.h" #include "paddle/cinn/hlir/framework/pass.h" diff --git a/paddle/cinn/poly/domain_add_unit_loop_mutator.h b/paddle/cinn/poly/domain_add_unit_loop_mutator.h index 0b2ce648b76..6c0a289ef36 100644 --- a/paddle/cinn/poly/domain_add_unit_loop_mutator.h +++ b/paddle/cinn/poly/domain_add_unit_loop_mutator.h @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#pragma once + #include #include diff --git a/paddle/cinn/runtime/cpu/mkldnn_math.h b/paddle/cinn/runtime/cpu/mkldnn_math.h index c8cb49c1cc3..8e6b2003788 100644 --- a/paddle/cinn/runtime/cpu/mkldnn_math.h +++ b/paddle/cinn/runtime/cpu/mkldnn_math.h @@ -16,7 +16,7 @@ #include "paddle/cinn/runtime/cinn_runtime.h" #ifdef CINN_WITH_MKLDNN -#include "dnnl.hpp" +#include "dnnl.hpp" // NOLINT #endif // define some C APIs diff --git a/paddle/cinn/runtime/cuda/test_util.h b/paddle/cinn/runtime/cuda/test_util.h index 7a5683471dc..71786653b49 100644 --- a/paddle/cinn/runtime/cuda/test_util.h +++ b/paddle/cinn/runtime/cuda/test_util.h @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#pragma once #include #include diff --git a/paddle/cinn/runtime/tiny_runtime.cc b/paddle/cinn/runtime/tiny_runtime.cc index 8fb0238cbc3..54219e5cc01 100644 --- a/paddle/cinn/runtime/tiny_runtime.cc +++ b/paddle/cinn/runtime/tiny_runtime.cc @@ -21,7 +21,7 @@ #include #include -#include "cinn_runtime.h" +#include "paddle/cinn/runtime/cinn_runtime.h" extern "C" { int max_num_workers = std::thread::hardware_concurrency(); -- GitLab