From b0c9f24a3e0e71fa9106f0976fb43567913e5fee Mon Sep 17 00:00:00 2001 From: Chen Weihang Date: Tue, 12 Jul 2022 01:43:37 -0500 Subject: [PATCH] [PHI] Clean glog header in public header (#44216) * clean glog header in public header * move marco pos --- paddle/phi/backends/device_manager.cc | 2 ++ paddle/phi/backends/dynload/port.cc | 2 ++ paddle/phi/backends/dynload/port.h | 1 - paddle/phi/backends/gpu/gpu_info.cc | 1 + paddle/phi/backends/gpu/gpu_launch_config.h | 1 + paddle/phi/core/meta_tensor.cc | 2 ++ paddle/phi/core/meta_tensor.h | 1 - paddle/phi/infermeta/binary.cc | 2 ++ paddle/phi/infermeta/ternary.cc | 2 ++ paddle/phi/kernels/funcs/data_type_transform.h | 2 ++ paddle/phi/kernels/gpu/allclose_kernel.cu | 2 ++ paddle/phi/kernels/impl/einsum_impl.h | 2 ++ paddle/phi/kernels/sparse/cpu/elementwise_grad_kernel.cc | 2 ++ 13 files changed, 20 insertions(+), 2 deletions(-) diff --git a/paddle/phi/backends/device_manager.cc b/paddle/phi/backends/device_manager.cc index ffaf42a0cf4..5b1022794a5 100644 --- a/paddle/phi/backends/device_manager.cc +++ b/paddle/phi/backends/device_manager.cc @@ -24,6 +24,8 @@ #include #include +#include "glog/logging.h" + namespace phi { void Device::CreateStream(stream::Stream* stream, diff --git a/paddle/phi/backends/dynload/port.cc b/paddle/phi/backends/dynload/port.cc index 59884176548..d1b3da64c85 100644 --- a/paddle/phi/backends/dynload/port.cc +++ b/paddle/phi/backends/dynload/port.cc @@ -18,6 +18,8 @@ #include #include +#include "glog/logging.h" + #if !defined(_WIN32) #include // dladdr #include diff --git a/paddle/phi/backends/dynload/port.h b/paddle/phi/backends/dynload/port.h index ed48553accb..03a2863e4dc 100644 --- a/paddle/phi/backends/dynload/port.h +++ b/paddle/phi/backends/dynload/port.h @@ -17,7 +17,6 @@ #include #define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h -#include "glog/logging.h" #if !defined(_WIN32) #include // dladdr diff --git a/paddle/phi/backends/gpu/gpu_info.cc b/paddle/phi/backends/gpu/gpu_info.cc index cc655f18229..a2399554ba8 100644 --- a/paddle/phi/backends/gpu/gpu_info.cc +++ b/paddle/phi/backends/gpu/gpu_info.cc @@ -14,6 +14,7 @@ limitations under the License. */ #include "paddle/phi/backends/gpu/gpu_info.h" +#include #include #include "gflags/gflags.h" diff --git a/paddle/phi/backends/gpu/gpu_launch_config.h b/paddle/phi/backends/gpu/gpu_launch_config.h index 04b2786c4d0..552f60783c8 100644 --- a/paddle/phi/backends/gpu/gpu_launch_config.h +++ b/paddle/phi/backends/gpu/gpu_launch_config.h @@ -30,6 +30,7 @@ #include #include +#include "glog/logging.h" #include "paddle/phi/backends/gpu/gpu_context.h" #include "paddle/phi/core/enforce.h" diff --git a/paddle/phi/core/meta_tensor.cc b/paddle/phi/core/meta_tensor.cc index 2178855aa0f..f0cd841235e 100644 --- a/paddle/phi/core/meta_tensor.cc +++ b/paddle/phi/core/meta_tensor.cc @@ -14,6 +14,8 @@ limitations under the License. */ #include "paddle/phi/core/meta_tensor.h" +#include "glog/logging.h" + #include "paddle/phi/core/dense_tensor.h" #include "paddle/phi/core/enforce.h" #include "paddle/phi/core/selected_rows.h" diff --git a/paddle/phi/core/meta_tensor.h b/paddle/phi/core/meta_tensor.h index 27175916186..377d0e9bc4d 100644 --- a/paddle/phi/core/meta_tensor.h +++ b/paddle/phi/core/meta_tensor.h @@ -14,7 +14,6 @@ limitations under the License. */ #pragma once -#include "glog/logging.h" #include "paddle/phi/common/data_type.h" #include "paddle/phi/common/layout.h" #include "paddle/phi/core/ddim.h" diff --git a/paddle/phi/infermeta/binary.cc b/paddle/phi/infermeta/binary.cc index 1ba025e2c62..269286d76d9 100644 --- a/paddle/phi/infermeta/binary.cc +++ b/paddle/phi/infermeta/binary.cc @@ -17,6 +17,8 @@ limitations under the License. */ #include #include +#include "glog/logging.h" + #include "paddle/phi/common/data_type.h" #include "paddle/phi/common/layout.h" #include "paddle/phi/core/ddim.h" diff --git a/paddle/phi/infermeta/ternary.cc b/paddle/phi/infermeta/ternary.cc index a22f720b97e..9f65de0f0aa 100644 --- a/paddle/phi/infermeta/ternary.cc +++ b/paddle/phi/infermeta/ternary.cc @@ -14,6 +14,8 @@ limitations under the License. */ #include "paddle/phi/infermeta/ternary.h" +#include "glog/logging.h" + #include "paddle/phi/common/layout.h" #include "paddle/phi/core/ddim.h" #include "paddle/phi/kernels/funcs/common_shape.h" diff --git a/paddle/phi/kernels/funcs/data_type_transform.h b/paddle/phi/kernels/funcs/data_type_transform.h index ad7f2aa192c..72fa94d4ed2 100644 --- a/paddle/phi/kernels/funcs/data_type_transform.h +++ b/paddle/phi/kernels/funcs/data_type_transform.h @@ -14,6 +14,8 @@ limitations under the License. */ #pragma once +#include "glog/logging.h" + #include "paddle/phi/common/data_type.h" #include "paddle/phi/core/dense_tensor.h" #include "paddle/phi/kernels/cast_kernel.h" diff --git a/paddle/phi/kernels/gpu/allclose_kernel.cu b/paddle/phi/kernels/gpu/allclose_kernel.cu index 8abc6b272c5..fa6a8fce0bf 100644 --- a/paddle/phi/kernels/gpu/allclose_kernel.cu +++ b/paddle/phi/kernels/gpu/allclose_kernel.cu @@ -14,6 +14,8 @@ #include "paddle/phi/kernels/allclose_kernel.h" +#include "glog/logging.h" + #include "paddle/phi/core/enforce.h" #include "paddle/phi/core/kernel_registry.h" diff --git a/paddle/phi/kernels/impl/einsum_impl.h b/paddle/phi/kernels/impl/einsum_impl.h index 43b2760b404..b5bc826881a 100644 --- a/paddle/phi/kernels/impl/einsum_impl.h +++ b/paddle/phi/kernels/impl/einsum_impl.h @@ -15,6 +15,8 @@ #include +#include "glog/logging.h" + #include "paddle/phi/core/dense_tensor.h" #include "paddle/phi/kernels/matmul_kernel.h" #include "paddle/phi/kernels/reduce_sum_kernel.h" diff --git a/paddle/phi/kernels/sparse/cpu/elementwise_grad_kernel.cc b/paddle/phi/kernels/sparse/cpu/elementwise_grad_kernel.cc index d9ebbd10267..972b4537b95 100644 --- a/paddle/phi/kernels/sparse/cpu/elementwise_grad_kernel.cc +++ b/paddle/phi/kernels/sparse/cpu/elementwise_grad_kernel.cc @@ -12,6 +12,8 @@ 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. */ +#include "glog/logging.h" + #include "paddle/phi/backends/cpu/cpu_context.h" #include "paddle/phi/core/enforce.h" #include "paddle/phi/core/kernel_registry.h" -- GitLab