diff --git a/paddle/fluid/framework/feed_fetch_method.cc b/paddle/fluid/framework/feed_fetch_method.cc index 36ab906181be5bf2e2c800e8c0d09eac62525fcf..47bb60810eb487314d22a4f264785bb6e37c21fe 100644 --- a/paddle/fluid/framework/feed_fetch_method.cc +++ b/paddle/fluid/framework/feed_fetch_method.cc @@ -14,7 +14,6 @@ limitations under the License. */ #include "paddle/fluid/framework/feed_fetch_method.h" -#include #include #include "glog/logging.h" diff --git a/paddle/fluid/framework/feed_fetch_type.h b/paddle/fluid/framework/feed_fetch_type.h index 8ecd6a0339b5bc21ab6f5f534960cde4ca652212..3fe545ec9c5699a3783f8795a713b5f1a89cd8fc 100644 --- a/paddle/fluid/framework/feed_fetch_type.h +++ b/paddle/fluid/framework/feed_fetch_type.h @@ -19,7 +19,6 @@ limitations under the License. */ #include "paddle/fluid/framework/lod_tensor.h" #include "paddle/fluid/framework/lod_tensor_array.h" #include "paddle/fluid/framework/string_array.h" -#include "paddle/fluid/platform/variant.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/ir/cost_model.h b/paddle/fluid/framework/ir/cost_model.h index 27f059a81eb1f67e9f4b04a0180d0808287585b7..558f158e84e727388a2750d378c21afd36d0a084 100644 --- a/paddle/fluid/framework/ir/cost_model.h +++ b/paddle/fluid/framework/ir/cost_model.h @@ -27,7 +27,6 @@ #include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/platform/profiler.h" #include "paddle/fluid/platform/profiler/event_tracing.h" -#include "paddle/fluid/platform/variant.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/ir/graph.h b/paddle/fluid/framework/ir/graph.h index ea5c46e3040bd59b721ee50c2f2f66ed6ff4d420..5a954110775d67c1a6e4d3ba20097a9ee248cca8 100644 --- a/paddle/fluid/framework/ir/graph.h +++ b/paddle/fluid/framework/ir/graph.h @@ -25,7 +25,7 @@ limitations under the License. */ #include "paddle/fluid/framework/ir/node.h" #include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/platform/enforce.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/utils/any.h" DECLARE_bool(convert_all_blocks); diff --git a/paddle/fluid/framework/ir/pass.h b/paddle/fluid/framework/ir/pass.h index 967482d2419e9a7b5b2dc933be23a618a9a014ab..37a28bec16da2dcce94fd61e732da3a026109447 100644 --- a/paddle/fluid/framework/ir/pass.h +++ b/paddle/fluid/framework/ir/pass.h @@ -25,7 +25,7 @@ limitations under the License. */ #include "paddle/fluid/framework/ir/graph.h" #include "paddle/fluid/framework/ir/node.h" #include "paddle/fluid/framework/program_desc.h" -#include "paddle/fluid/platform/variant.h" +#include "paddle/phi/core/macros.h" #include "paddle/utils/any.h" namespace paddle { diff --git a/paddle/fluid/framework/op_version_registry.h b/paddle/fluid/framework/op_version_registry.h index c88b947edc68656919088eafd6fb37f6f26f55f6..579dd320d144fbc1c9f9e85e0e55a8c3d3f4991d 100644 --- a/paddle/fluid/framework/op_version_registry.h +++ b/paddle/fluid/framework/op_version_registry.h @@ -22,6 +22,7 @@ limitations under the License. */ #include "paddle/fluid/framework/op_version_proto.h" #include "paddle/fluid/platform/enforce.h" +#include "paddle/phi/core/macros.h" #include "paddle/utils/none.h" namespace paddle { diff --git a/paddle/fluid/framework/operator.h b/paddle/fluid/framework/operator.h index d468ead659258245a7fd798f7ea22d45de76269a..1b7bd433dd104dab11d41c664e1bcff6c75591fa 100644 --- a/paddle/fluid/framework/operator.h +++ b/paddle/fluid/framework/operator.h @@ -38,7 +38,7 @@ limitations under the License. */ #include "paddle/fluid/framework/unused_var_check.h" #include "paddle/fluid/memory/malloc.h" #include "paddle/fluid/platform/device_context.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/phi/core/compat/arg_map_context.h" #include "paddle/phi/core/compat/op_utils.h" #include "paddle/phi/core/kernel_factory.h" diff --git a/paddle/fluid/framework/tuple.h b/paddle/fluid/framework/tuple.h index 6c283f4d32e572e3e811f866219460a7dfb2f83c..a06f92f32d28cd62194a98661c23783e83c14842 100644 --- a/paddle/fluid/framework/tuple.h +++ b/paddle/fluid/framework/tuple.h @@ -22,7 +22,6 @@ limitations under the License. */ #include "paddle/fluid/framework/tensor.h" #include "paddle/fluid/framework/var_desc.h" #include "paddle/fluid/platform/enforce.h" -#include "paddle/fluid/platform/variant.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/framework/type_defs.h b/paddle/fluid/framework/type_defs.h index 5c768b10a3d7e70270cad2e8d438cd319d0aef14..3bcad63f21a841d4be1eeca5360485a6760eb260 100644 --- a/paddle/fluid/framework/type_defs.h +++ b/paddle/fluid/framework/type_defs.h @@ -23,7 +23,7 @@ limitations under the License. */ #include #include "paddle/fluid/imperative/type_defs.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/utils/blank.h" #include "paddle/utils/small_vector.h" #include "paddle/utils/variant.h" diff --git a/paddle/fluid/inference/analysis/argument.h b/paddle/fluid/inference/analysis/argument.h index 016df40c86a2da4d7e3ed064abcac35c82198374..e69a1e0e1ffb0b723f80362efad680a96533564d 100644 --- a/paddle/fluid/inference/analysis/argument.h +++ b/paddle/fluid/inference/analysis/argument.h @@ -35,7 +35,7 @@ #include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/framework/scope.h" #include "paddle/fluid/inference/api/paddle_analysis_config.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/phi/common/data_type.h" namespace paddle { diff --git a/paddle/fluid/memory/stats.cc b/paddle/fluid/memory/stats.cc index 12312a28f6c2a12e86bae5e72923b22e782a76db..0289859dff30eb8be097fc4b85c37db68a5ebed2 100644 --- a/paddle/fluid/memory/stats.cc +++ b/paddle/fluid/memory/stats.cc @@ -15,7 +15,7 @@ limitations under the License. */ #include "paddle/fluid/memory/stats.h" #include "paddle/fluid/memory/allocation/spin_lock.h" -#include "paddle/fluid/platform/variant.h" +#include "paddle/phi/core/macros.h" namespace paddle { namespace memory { diff --git a/paddle/fluid/operators/controlflow/op_variant.h b/paddle/fluid/operators/controlflow/op_variant.h index c75294ce9ab7a32d861eac8a3f38f0abb1bacf82..04afe548e92e3ec4985884db5fbfa2db2c744942 100644 --- a/paddle/fluid/operators/controlflow/op_variant.h +++ b/paddle/fluid/operators/controlflow/op_variant.h @@ -18,7 +18,6 @@ #include "paddle/fluid/framework/operator.h" #include "paddle/fluid/framework/program_desc.h" -#include "paddle/fluid/platform/variant.h" namespace paddle { namespace framework { diff --git a/paddle/fluid/operators/controlflow/recurrent_op_helper.h b/paddle/fluid/operators/controlflow/recurrent_op_helper.h index 78fabec56f51a7fec624ab9ef70029363ef3769d..752a0a1f764eb91fcd127c335711ea76b8f7b39f 100644 --- a/paddle/fluid/operators/controlflow/recurrent_op_helper.h +++ b/paddle/fluid/operators/controlflow/recurrent_op_helper.h @@ -23,7 +23,7 @@ #include "paddle/fluid/framework/operator.h" #include "paddle/fluid/operators/controlflow/op_variant.h" #include "paddle/fluid/operators/recurrent_op.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/fluid/string/string_helper.h" namespace paddle { diff --git a/paddle/fluid/operators/controlflow/while_op_helper.h b/paddle/fluid/operators/controlflow/while_op_helper.h index 46c3b056bfdf1997285028d6684a25656c89cb82..8f7db23769a7e4c0804045c386f07c30001152f5 100644 --- a/paddle/fluid/operators/controlflow/while_op_helper.h +++ b/paddle/fluid/operators/controlflow/while_op_helper.h @@ -20,7 +20,6 @@ #include "paddle/fluid/framework/operator.h" #include "paddle/fluid/operators/controlflow/op_variant.h" -#include "paddle/fluid/platform/variant.h" namespace phi { class DenseTensor; diff --git a/paddle/fluid/operators/jit/benchmark.cc b/paddle/fluid/operators/jit/benchmark.cc index 7ffdd6ff32ba710bea552bc01467aa1a41f2661d..50fd6056d84b0043cbce6837ac87c3dec6a64826 100644 --- a/paddle/fluid/operators/jit/benchmark.cc +++ b/paddle/fluid/operators/jit/benchmark.cc @@ -22,7 +22,6 @@ #include "paddle/fluid/platform/device_tracer.h" #include "paddle/fluid/platform/enforce.h" #include "paddle/fluid/platform/place.h" -#include "paddle/fluid/platform/variant.h" // for UNUSED DEFINE_int32(burning, 10, "Burning times."); DEFINE_int32(repeat, 3000, "Repeat times."); diff --git a/paddle/fluid/operators/jit/registry.h b/paddle/fluid/operators/jit/registry.h index b006d21f3b558459dce2aaeb120f29b917dc9005..9d0e47e8260753d635e6c90f42f576814fcb7bc8 100644 --- a/paddle/fluid/operators/jit/registry.h +++ b/paddle/fluid/operators/jit/registry.h @@ -22,7 +22,7 @@ #include "paddle/fluid/operators/jit/kernel_base.h" #include "paddle/fluid/operators/jit/kernel_pool.h" #include "paddle/fluid/platform/place.h" -#include "paddle/fluid/platform/variant.h" // for UNUSED +#include "paddle/phi/core/macros.h" namespace paddle { namespace operators { diff --git a/paddle/fluid/operators/math/matrix_bit_code.h b/paddle/fluid/operators/math/matrix_bit_code.h index 780003c1b451e29c31154548641450ab9fdb9bae..7c9d94aa8713bd5cd1b93cec3cc66c5d635de98e 100644 --- a/paddle/fluid/operators/math/matrix_bit_code.h +++ b/paddle/fluid/operators/math/matrix_bit_code.h @@ -23,7 +23,7 @@ limitations under the License. */ #include "paddle/fluid/framework/selected_rows_utils.h" #include "paddle/fluid/framework/tensor.h" #include "paddle/fluid/platform/device_context.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/phi/kernels/funcs/blas/blas.h" #if defined(_WIN32) diff --git a/paddle/fluid/platform/enforce.h b/paddle/fluid/platform/enforce.h index 4f26ce0b27dbf4051cf18e51637af9474001ca36..6b33af9ac10baee8c77473c9ceadc5b248db508a 100644 --- a/paddle/fluid/platform/enforce.h +++ b/paddle/fluid/platform/enforce.h @@ -66,7 +66,7 @@ limitations under the License. */ #include "glog/logging.h" #include "paddle/fluid/platform/errors.h" #include "paddle/fluid/platform/macros.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/fluid/string/printf.h" #include "paddle/fluid/string/to_string.h" #include "paddle/phi/backends/dynload/port.h" diff --git a/paddle/fluid/platform/flags.h b/paddle/fluid/platform/flags.h index 03986816c53f9f1932eb9393311953ff63791d7f..6db5e710b8dc83f6614f7cc6e284f046e4d74908 100644 --- a/paddle/fluid/platform/flags.h +++ b/paddle/fluid/platform/flags.h @@ -21,7 +21,7 @@ #include "gflags/gflags.h" #include "paddle/fluid/platform/macros.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/utils/variant.h" namespace paddle { diff --git a/paddle/fluid/platform/monitor.h b/paddle/fluid/platform/monitor.h index e7612f6dcb6cde82c1a513170b800992f74a3527..a0c1129d2cb8745a112e70746d2051e4dbfc5999 100644 --- a/paddle/fluid/platform/monitor.h +++ b/paddle/fluid/platform/monitor.h @@ -26,6 +26,8 @@ #include "glog/logging.h" +#include "paddle/phi/core/macros.h" + namespace paddle { namespace platform { diff --git a/paddle/fluid/platform/place.h b/paddle/fluid/platform/place.h index d544cdecc3994a4158a27592a16345f1f14824bf..cde17007715a67061b45273ff9316293d87cb905 100644 --- a/paddle/fluid/platform/place.h +++ b/paddle/fluid/platform/place.h @@ -18,7 +18,7 @@ limitations under the License. */ // #include #include "paddle/fluid/platform/enforce.h" -// #include "paddle/fluid/platform/variant.h" +// #ifdef PADDLE_WITH_ASCEND_CL #include "paddle/fluid/platform/device/npu/enforce_npu.h" #endif diff --git a/paddle/fluid/platform/variant.h b/paddle/fluid/platform/variant.h deleted file mode 100644 index 9682749898fc77af54d81c1dccdac3b474dcd9ca..0000000000000000000000000000000000000000 --- a/paddle/fluid/platform/variant.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. - -Licensed 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. */ - -#pragma once - -// Boost 1.41.0 requires __CUDACC_VER__, but in CUDA 9 __CUDACC_VER__ -// is removed, so we have to manually define __CUDACC_VER__ instead. -// For details, please refer to -// https://github.com/PaddlePaddle/Paddle/issues/6626 -#if defined(__CUDACC__) && defined(__CUDACC_VER_MAJOR__) -#undef __CUDACC_VER__ -#define __CUDACC_VER__ \ - __CUDACC_VER_BUILD__ + __CUDACC_VER_MAJOR__ * 10000 + \ - __CUDACC_VER_MINOR__ * 100 -#endif - -#include "boost/config.hpp" - -// Because Boost 1.41.0's variadic templates has bug on nvcc, boost -// will disable variadic template support in NVCC mode. Define -// BOOST_NO_CXX11_VARIADIC_TEMPLATES on gcc/clang to generate same -// function symbols. For details, -// https://github.com/PaddlePaddle/Paddle/issues/3386 -#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) -#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES -#define BOOST_NO_CXX11_VARIADIC_TEMPLATES -#endif -#endif - -#include -#include - -#include "paddle/utils/any.h" -#include "paddle/utils/optional.h" - -// some platform-independent defintion -#if defined(_WIN32) -#define UNUSED -#define __builtin_expect(EXP, C) (EXP) -#else -#define UNUSED __attribute__((unused)) -#endif diff --git a/paddle/fluid/pybind/data_set_py.cc b/paddle/fluid/pybind/data_set_py.cc index d5f84d7382105fffd97e65b448497ba374b5e86d..e1950ade92fb2297132f7a140e57a445f59ca48d 100644 --- a/paddle/fluid/pybind/data_set_py.cc +++ b/paddle/fluid/pybind/data_set_py.cc @@ -35,7 +35,7 @@ limitations under the License. */ #include "paddle/fluid/framework/scope.h" #include "paddle/fluid/inference/io.h" #include "paddle/fluid/platform/place.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/fluid/pybind/data_set_py.h" namespace py = pybind11; diff --git a/paddle/fluid/pybind/fleet_wrapper_py.cc b/paddle/fluid/pybind/fleet_wrapper_py.cc index 05028a9b70efbe4bd8dde1aecfdf666cf237972a..8626659d8633afec4c09cd9c609c181307a9a570 100644 --- a/paddle/fluid/pybind/fleet_wrapper_py.cc +++ b/paddle/fluid/pybind/fleet_wrapper_py.cc @@ -33,7 +33,7 @@ limitations under the License. */ #include "paddle/fluid/framework/scope.h" #include "paddle/fluid/inference/io.h" #include "paddle/fluid/platform/place.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/fluid/pybind/fleet_wrapper_py.h" namespace py = pybind11; diff --git a/paddle/fluid/pybind/global_value_getter_setter.cc b/paddle/fluid/pybind/global_value_getter_setter.cc index b2a52e568aed9fa317b0592ac0b3f8f6b71ab5af..c45566ba356732bd9ada901c4e92aee4bbe5085c 100644 --- a/paddle/fluid/pybind/global_value_getter_setter.cc +++ b/paddle/fluid/pybind/global_value_getter_setter.cc @@ -27,6 +27,7 @@ #include "paddle/fluid/platform/enforce.h" #include "paddle/fluid/platform/errors.h" #include "paddle/fluid/platform/macros.h" +#include "paddle/phi/core/macros.h" #include "pybind11/stl.h" // FIXME(zengjinle): these 2 flags may be removed by the linker when compiling diff --git a/paddle/fluid/pybind/metrics_py.cc b/paddle/fluid/pybind/metrics_py.cc index 50318cf9e6fc43d5190a7ec98ddb63e5669c89a5..78e6d528b1af35d58ff20d819938af1688382299 100644 --- a/paddle/fluid/pybind/metrics_py.cc +++ b/paddle/fluid/pybind/metrics_py.cc @@ -27,7 +27,7 @@ limitations under the License. */ #include "paddle/fluid/framework/scope.h" #include "paddle/fluid/inference/io.h" #include "paddle/fluid/platform/place.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/fluid/pybind/metrics_py.h" namespace py = pybind11; diff --git a/paddle/fluid/pybind/nccl_wrapper_py.cc b/paddle/fluid/pybind/nccl_wrapper_py.cc index bbba03f6660fe9ddb14764709ea81a9a82b1b386..827bcaf39704daed8c3b3cd49f3b88de62f562f7 100644 --- a/paddle/fluid/pybind/nccl_wrapper_py.cc +++ b/paddle/fluid/pybind/nccl_wrapper_py.cc @@ -33,7 +33,7 @@ limitations under the License. */ #include "paddle/fluid/framework/scope.h" #include "paddle/fluid/inference/io.h" #include "paddle/fluid/platform/place.h" -#include "paddle/fluid/platform/variant.h" + #include "paddle/fluid/pybind/nccl_wrapper_py.h" namespace py = pybind11; diff --git a/paddle/fluid/pybind/protobuf.h b/paddle/fluid/pybind/protobuf.h index 54b788cccba5b161bc54b65be16422db8a25e916..79f174b5eb607abb2305e99ac14edb5c18730b99 100644 --- a/paddle/fluid/pybind/protobuf.h +++ b/paddle/fluid/pybind/protobuf.h @@ -22,7 +22,6 @@ typedef SSIZE_T ssize_t; #include #include -#include "paddle/fluid/platform/variant.h" #include "pybind11/numpy.h" #include "pybind11/pybind11.h" #include "pybind11/stl.h" diff --git a/paddle/utils/tribool.h b/paddle/utils/tribool.h index 98a5019d715356de79aa71f603ce4bea00e1b140..9ede76f3ec15eb4aa4140ce9eb227937a4040b83 100644 --- a/paddle/utils/tribool.h +++ b/paddle/utils/tribool.h @@ -18,6 +18,7 @@ // 2. remove the depending boost header files // 3. remove the dummy_ in indeterminate_t, which is specially implemented for // Borland C++ Builder +// 4. remove unnecessary macro BOOST_TRIBOOL_THIRD_STATE // Three-state boolean logic library @@ -437,27 +438,3 @@ namespace paddle { using logic::indeterminate; using logic::tribool; } // namespace paddle - -/** - * \brief Declare a new name for the third state of a tribool - * - * Use this macro to declare a new name for the third state of a - * tribool. This state can have any number of new names (in addition - * to \c indeterminate), all of which will be equivalent. The new name will be - * placed in the namespace in which the macro is expanded. - * - * Example: - * PADDLE_TRIBOOL_THIRD_STATE(true_or_false) - * - * tribool x(true_or_false); - * // potentially set x - * if (true_or_false(x)) { - * // don't know what x is - * } - */ -#define PADDLE_TRIBOOL_THIRD_STATE(Name) \ - inline bool Name(boost::logic::tribool x, \ - boost::logic::detail::indeterminate_t dummy = \ - boost::logic::detail::indeterminate_t()) { \ - return x.value == boost::logic::tribool::indeterminate_value; \ - } diff --git a/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_c_setup.py b/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_c_setup.py index a94307161d43171bddb64e92bbaf491ea0989b0f..11fdc9d0addfa8a3ace81c8a276add0760a329f6 100644 --- a/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_c_setup.py +++ b/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_c_setup.py @@ -51,7 +51,6 @@ paddle_custom_kernel_include = [ compile_third_party_path = os.path.join(os.environ['PADDLE_ROOT'], 'build/third_party') paddle_custom_kernel_include += [ - os.path.join(compile_third_party_path, 'boost/src/extern_boost'), # boost os.path.join(compile_third_party_path, 'install/gflags/include'), # gflags os.path.join(compile_third_party_path, 'install/glog/include'), # glog ] diff --git a/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_setup.py b/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_setup.py index 94de1a39ccfbb427a8f022fbdc4a8a88680d5dd3..8147fc3d343d642f3b16989d1fb8388c1b1cd4b1 100644 --- a/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_setup.py +++ b/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_setup.py @@ -53,7 +53,6 @@ paddle_custom_kernel_include = list( compile_third_party_path = os.path.join(os.environ['PADDLE_ROOT'], 'build/third_party') paddle_custom_kernel_include += [ - os.path.join(compile_third_party_path, 'boost/src/extern_boost'), # boost os.path.join(compile_third_party_path, 'install/gflags/include'), # gflags os.path.join(compile_third_party_path, 'install/glog/include'), # glog ] diff --git a/tools/prune_for_jetson.py b/tools/prune_for_jetson.py index d53b21d6c37233958ad55535d6a1229a4b88a62a..cbc03393360d2290b873997298c658ebe9b4bd95 100644 --- a/tools/prune_for_jetson.py +++ b/tools/prune_for_jetson.py @@ -125,7 +125,7 @@ def append_fluid_kernels(): with io.open(file_name, 'r', encoding='utf-8') as f: content = ''.join(f.readlines()) - location_str = "nv_library(\n tensorrt_op_teller\n SRCS op_teller.cc\n DEPS framework_proto device_context boost)" + location_str = "nv_library(\n tensorrt_op_teller\n SRCS op_teller.cc\n DEPS framework_proto device_context)" new_content = content.replace(location_str, location_str + append_str) if new_content == content: