Skip to content

Commit

Permalink
[enforce.h Decouple logging.h] Delete glog/logging.h from enforce.h (#…
Browse files Browse the repository at this point in the history
…52651)

* [enforce.h Decouple logging.h] Delete glog/logging.h from enforce.h

* Add logging.h for profiler.cc

* Add logging.h for gloo_utils.h

* Add logging.h for addmm_kernel_impl.h

* Add logging.h for addmm_grad_kernel_impl.h

* Add logging.h for p_send_kernel.cu

* Add logging.h for determinant_grad_kernel_impl.h

* Add logging.h for p_recv_kernel.cu

* Add logging.h for elementwise_grad_base.h

* Add logging.h for transfer_layout_kernel.cc

* Add logging.h for eigvals_kernel.cc and index_select_impl.h

* Add logging.h for all files in kernel directory

* Add logging.h for xpu_info.cc

* Add logging.h for xpu
  • Loading branch information
jiahy0825 authored Apr 13, 2023
1 parent 0695fb8 commit 5664ea2
Show file tree
Hide file tree
Showing 136 changed files with 278 additions and 5 deletions.
2 changes: 2 additions & 0 deletions paddle/fluid/framework/ir/delete_cast_op_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "paddle/fluid/framework/ir/delete_cast_op_pass.h"

#include "glog/logging.h"

#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
#include "paddle/fluid/framework/op_version_registry.h"
#include "paddle/fluid/platform/enforce.h"
Expand Down
3 changes: 3 additions & 0 deletions paddle/fluid/framework/ir/xpu/conv2d_xpu_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// limitations under the License.

#include <string>

#include "glog/logging.h"

#include "paddle/fluid/framework/ir/fuse_pass_base.h"
#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
#include "paddle/fluid/framework/ir/pass.h"
Expand Down
3 changes: 3 additions & 0 deletions paddle/fluid/framework/ir/xpu/delete_isolated_node_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// limitations under the License.

#include <string>

#include "glog/logging.h"

#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
#include "paddle/fluid/framework/ir/pass.h"
#include "paddle/fluid/framework/ir/xpu/pass_utils.h"
Expand Down
3 changes: 3 additions & 0 deletions paddle/fluid/framework/ir/xpu/fc_xpu_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// limitations under the License.

#include <string>

#include "glog/logging.h"

#include "paddle/fluid/framework/ir/fuse_pass_base.h"
#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
#include "paddle/fluid/framework/ir/pass.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// limitations under the License.

#include <string>

#include "glog/logging.h"

#include "paddle/fluid/framework/ir/fuse_pass_base.h"
#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
#include "paddle/fluid/framework/ir/pass.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ limitations under the License. */

#include <gtest/gtest.h>

#include "glog/logging.h"

#include "paddle/fluid/framework/ir/pass.h"
#include "paddle/fluid/framework/ir/pass_tester_helper.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// limitations under the License.

#include <string>

#include "glog/logging.h"

#include "paddle/fluid/framework/convert_utils.h"
#include "paddle/fluid/framework/ir/fuse_pass_base.h"
#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
Expand Down
3 changes: 3 additions & 0 deletions paddle/fluid/framework/ir/xpu/link_xpu_op_max_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// limitations under the License.

#include <string>

#include "glog/logging.h"

#include "paddle/fluid/framework/ir/fuse_pass_base.h"
#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
#include "paddle/fluid/framework/ir/pass.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// limitations under the License.

#include <string>

#include "glog/logging.h"

#include "paddle/fluid/framework/ir/fuse_pass_base.h"
#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
#include "paddle/fluid/framework/ir/pass.h"
Expand Down
3 changes: 3 additions & 0 deletions paddle/fluid/framework/ir/xpu/one_beam_size_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

#include "paddle/fluid/framework/ir/xpu/one_beam_size_fuse_pass.h"
#include <string>

#include "glog/logging.h"

#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
#include "paddle/fluid/framework/ir/xpu/pass_utils.h"
#include "paddle/fluid/framework/op_version_registry.h"
Expand Down
3 changes: 3 additions & 0 deletions paddle/fluid/framework/ir/xpu/stack_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// limitations under the License.

#include <string>

#include "glog/logging.h"

#include "paddle/fluid/framework/ir/fuse_pass_base.h"
#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
#include "paddle/fluid/framework/ir/pass.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <utility>
#include <vector>

#include "glog/logging.h"

#include "paddle/fluid/memory/allocation/allocator.h"
#include "paddle/fluid/platform/cuda_device_guard.h"
#include "paddle/fluid/platform/device_context.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/fluid/platform/device/xpu/bkcl_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <unordered_map>
#include <vector>

#include "glog/logging.h"

#include "paddle/fluid/framework/data_type.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/platform/collective_helper.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/fluid/platform/device/xpu/xpu_op_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ limitations under the License. */
#include <string>
#include <unordered_set>

#include "glog/logging.h"

#include "paddle/fluid/framework/convert_utils.h"
#include "paddle/fluid/platform/device/xpu/xpu_info.h"
#include "paddle/phi/backends/xpu/xpu_op_kpfirst_list.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/api/lib/data_transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ limitations under the License. */

#include "paddle/phi/api/lib/data_transform.h"

#include "glog/logging.h"

#include "paddle/phi/api/lib/kernel_dispatch.h"
#include "paddle/phi/api/lib/utils/allocator.h"
#include "paddle/phi/backends/context_pool.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/api/lib/tensor_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ limitations under the License. */

#include "paddle/phi/api/lib/tensor_copy.h"

#include "glog/logging.h"

#include "paddle/phi/api/include/context_pool.h"
#include "paddle/phi/api/lib/api_gen_utils.h"
#include "paddle/phi/api/lib/kernel_dispatch.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/api/lib/tensor_method.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ limitations under the License. */

#include "paddle/phi/api/include/tensor.h"

#include "glog/logging.h"

#include "paddle/phi/common/int_array.h"
#include "paddle/phi/core/compat/convert_utils.h"
#include "paddle/phi/core/tensor_base.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/api/profiler/profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ limitations under the License. */
#include <string>
#include <type_traits>

#include "glog/logging.h"

#include "paddle/phi/api/profiler/common_event.h"
#include "paddle/phi/api/profiler/device_tracer.h"
#include "paddle/phi/api/profiler/host_event_recorder.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/api/yaml/generator/strings_api_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ def source_include(header_file_path):
#include "{header_file_path}"
#include "gflags/gflags.h"
#include "glog/logging.h"
#include "paddle/phi/api/lib/api_gen_utils.h"
#include "paddle/phi/core/kernel_context.h"
#include "paddle/phi/core/string_tensor.h"
Expand Down
3 changes: 3 additions & 0 deletions paddle/phi/backends/context_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ See the License for the specific language governing permissions and
limitations under the License. */

#include "paddle/phi/backends/context_pool.h"

#include "glog/logging.h"

#include "paddle/phi/common/memory_utils.h"
#include "paddle/phi/core/enforce.h"

Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/backends/custom/custom_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "glog/logging.h"

#include "paddle/phi/api/profiler/trace_event_collector.h"
#include "paddle/phi/backends/callback_manager.h"
#include "paddle/phi/backends/context_pool.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/backends/event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "paddle/phi/backends/event.h"

#include "glog/logging.h"

#include "paddle/phi/backends/device_guard.h"
#include "paddle/phi/backends/stream.h"

Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/backends/gpu/cuda/cuda_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "cuda.h" // NOLINT
#include "cuda_runtime.h" // NOLINT

#include "glog/logging.h"

#include "paddle/phi/backends/context_pool.h"
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/memory_utils.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/backends/gpu/cuda/cuda_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "paddle/phi/backends/gpu/gpu_info.h"

#include "glog/logging.h"

#include "paddle/phi/core/enforce.h"

static std::once_flag g_device_props_size_init_flag;
Expand Down
1 change: 1 addition & 0 deletions paddle/phi/backends/gpu/gpu_resources.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#endif // !defined(__APPLE__) && defined(PADDLE_WITH_NCCL)
#endif // PADDLE_WITH_CUDA

#include "glog/logging.h"
#include "unsupported/Eigen/CXX11/Tensor"

#include "paddle/phi/core/enforce.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/backends/onednn/onednn_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "paddle/phi/backends/context_pool.h"
#include "paddle/phi/core/expect.h"

#include "glog/logging.h"

namespace phi {

OneDNNContextThreadLocals::Body::Body()
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/backends/stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "paddle/phi/backends/stream.h"

#include "glog/logging.h"

#include "paddle/phi/backends/device_guard.h"
#include "paddle/phi/backends/event.h"

Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/backends/xpu/xpu_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include <memory>

#include "glog/logging.h"

#include "paddle/phi/api/ext/exception.h"
#include "paddle/phi/backends/xpu/enforce_xpu.h"
#include "paddle/phi/common/place.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/backends/xpu/xpu_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ limitations under the License. */
#include <cstdlib>
#include <string>

#include "glog/logging.h"

#include "paddle/phi/backends/xpu/enforce_xpu.h"
#include "paddle/phi/backends/xpu/xpu_context.h"
#include "paddle/phi/backends/xpu/xpu_header.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/core/cuda_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ using gpuStream_t = cudaStream_t;
using gpuStream_t = hipStream_t;
#endif

#include "glog/logging.h"

#include "paddle/phi/core/enforce.h"

namespace phi {
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/core/dense_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ limitations under the License. */

#include "paddle/phi/core/dense_tensor.h"

#include "glog/logging.h"

#include "paddle/phi/common/bfloat16.h"
#include "paddle/phi/common/complex.h"
#include "paddle/phi/common/float16.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/core/distributed/check/nccl_dynamic_check.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "paddle/phi/core/distributed/check/nccl_dynamic_check.h"

#include "glog/logging.h"

#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/core/errors.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/core/distributed/gloo_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <memory>
#include <string>

#include "glog/logging.h"

#include "paddle/phi/common/data_type.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/distributed/reduce_helper.h"
Expand Down
3 changes: 3 additions & 0 deletions paddle/phi/core/distributed/nccl_comm_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// limitations under the License.

#include "paddle/phi/core/distributed/nccl_comm_context.h"

#include "glog/logging.h"

#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/distributed/check/nccl_dynamic_check.h"
#include "paddle/phi/core/distributed/check/static_check.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/core/distributed/store/tcp_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <iostream>
#include <thread>

#include "glog/logging.h"

#include "paddle/phi/core/distributed/store/tcp_utils.h"
#include "paddle/phi/core/flags.h"

Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/core/distributed/store/tcp_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <cstring>
#include <thread>

#include "glog/logging.h"

namespace phi {
namespace distributed {
namespace tcputils {
Expand Down
1 change: 0 additions & 1 deletion paddle/phi/core/enforce.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ limitations under the License. */
#endif

#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
#include "glog/logging.h"
#include "paddle/phi/core/errors.h"

#include "paddle/phi/backends/dynload/port.h"
Expand Down
3 changes: 3 additions & 0 deletions paddle/phi/core/selected_rows_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ See the License for the specific language governing permissions and
limitations under the License. */

#include "paddle/phi/core/selected_rows_impl.h"

#include "glog/logging.h"

#include "paddle/phi/common/memory_utils.h"
#include "paddle/phi/core/utils/data_type.h"

Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/core/string_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ limitations under the License. */

#include "paddle/phi/core/string_tensor.h"

#include "glog/logging.h"

#include "paddle/phi/common/memory_utils.h"
#include "paddle/phi/common/pstring.h"

Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/core/tensor_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ limitations under the License. */

#include "paddle/phi/core/tensor_utils.h"

#include "glog/logging.h"

#include "paddle/phi/backends/context_pool.h"
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/data_type.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/infermeta/multiary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ limitations under the License. */

#include <vector>

#include "glog/logging.h"

#include "paddle/phi/backends/device_memory_aligment.h"
#include "paddle/phi/common/layout.h"
#include "paddle/phi/common/scalar.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/kernels/coalesce_tensor_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <sstream>
#include <vector>

#include "glog/logging.h"

#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/backends/device_memory_aligment.h"
#include "paddle/phi/backends/gpu/gpu_context.h"
Expand Down
2 changes: 2 additions & 0 deletions paddle/phi/kernels/cpu/adam_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include <vector>

#include "glog/logging.h"

#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/core/tensor_utils.h"
Expand Down
Loading

0 comments on commit 5664ea2

Please sign in to comment.