未验证 提交 df23c7c3 编写于 作者: P PuQing 提交者: GitHub

[PHI decoupling] remove "paddle/fluid/platform/enforce.h" in phi (#48049)

上级 e29c50c2
......@@ -18,7 +18,7 @@ lib=$1
if [ $# -ne 1 ]; then echo "No input library"; exit -1 ; fi
num_paddle_syms=$(nm -D "${lib}" | grep -c paddle )
num_google_syms=$(nm -D "${lib}" | grep google | grep -v paddle | grep -v brpc | grep -c "T " )
num_google_syms=$(nm -D "${lib}" | grep google | grep -v paddle | grep -v phi | grep -v brpc | grep -c "T " )
if [ $num_paddle_syms -le 0 ]; then echo "Have no paddle symbols"; exit -1 ; fi
if [ $num_google_syms -ge 1 ]; then echo "Have some google symbols"; exit -1 ; fi
......
proto_library(profiler_proto SRCS profiler.proto DEPS framework_proto
simple_threadpool)
if(WITH_GPU)
proto_library(external_error_proto SRCS external_error.proto)
endif()
if(WITH_PYTHON)
py_proto_compile(profiler_py_proto SRCS profiler.proto)
add_custom_target(profiler_py_proto_init ALL COMMAND ${CMAKE_COMMAND} -E
......
此差异已折叠。
......@@ -17,8 +17,8 @@
#include <ThreadPool.h>
#include "paddle/fluid/platform/device/device_wrapper.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/backends/device_guard.h"
#include "paddle/phi/core/enforce.h"
namespace phi {
......
......@@ -14,7 +14,7 @@ limitations under the License. */
#include "paddle/phi/backends/dynload/cudnn.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
namespace phi {
namespace dynload {
......
......@@ -14,7 +14,7 @@ limitations under the License. */
#include "paddle/phi/backends/dynload/cufft.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
namespace phi {
namespace dynload {
......
......@@ -17,8 +17,8 @@ limitations under the License. */
#include <string>
#include <vector>
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/backends/dynload/cupti_lib_path.h"
#include "paddle/phi/core/enforce.h"
#if defined(_WIN32)
#include <windows.h>
......
......@@ -14,7 +14,7 @@ limitations under the License. */
#include "paddle/phi/backends/dynload/miopen.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
namespace phi {
namespace dynload {
......
......@@ -21,8 +21,8 @@ limitations under the License. */
#include <mutex> // NOLINT
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/backends/dynload/dynamic_loader.h"
#include "paddle/phi/core/enforce.h"
namespace phi {
namespace dynload {
......
......@@ -14,8 +14,7 @@
#include "paddle/phi/backends/gpu/gpu_info.h"
// TODO(phi): remove fluid headers.
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
static std::once_flag g_device_props_size_init_flag;
static std::vector<std::unique_ptr<std::once_flag>> g_device_props_init_flags;
......
......@@ -21,6 +21,7 @@ limitations under the License. */
#include <future>
#include <memory>
#include <mutex>
#include <unordered_map>
#include "glog/logging.h"
#include "paddle/phi/api/ext/exception.h"
......@@ -54,8 +55,7 @@ limitations under the License. */
// without eigen.
#include "unsupported/Eigen/CXX11/Tensor"
// TODO(phi): remove fluid header.
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
namespace phi {
......
......@@ -32,8 +32,7 @@
#include "unsupported/Eigen/CXX11/Tensor"
// TODO(phi): remove fluid header.
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
namespace phi {
......
......@@ -16,12 +16,11 @@
#include "paddle/phi/backends/gpu/gpu_info.h"
// TODO(phi): remove fluid headers.
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
static std::once_flag g_device_props_size_init_flag;
static std::vector<std::unique_ptr<std::once_flag>> g_device_props_init_flags;
static std::vector<paddle::gpuDeviceProp> g_device_props;
static std::vector<phi::gpuDeviceProp> g_device_props;
namespace phi {
namespace backends {
......
......@@ -14,8 +14,8 @@ limitations under the License. */
#pragma once
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/backends/xpu/xpu_header.h"
#include "paddle/phi/core/enforce.h"
#ifdef PADDLE_WITH_XPU_BKCL
#include "xpu/bkcl.h"
#endif
......
......@@ -19,9 +19,9 @@ limitations under the License. */
#include <string>
#include <unordered_map>
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/common/bfloat16.h"
#include "paddle/phi/common/float16.h"
#include "paddle/phi/core/enforce.h"
#include "xpu/runtime.h"
#include "xpu/runtime_ex.h"
#include "xpu/xdnn.h"
......
# compatible utils used for fluid op system
add_subdirectory(compat)
if(WITH_GPU)
proto_library(external_error_proto SRCS external_error.proto)
endif()
cc_library(errors SRCS errors.cc)
set(phi_enforce_deps errors flags)
if(WITH_GPU)
......
......@@ -28,8 +28,7 @@ using gpuStream_t = cudaStream_t;
using gpuStream_t = hipStream_t;
#endif
// TODO(phi): remove fluid headers.
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
namespace phi {
......
此差异已折叠。
......@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
syntax = "proto2";
package paddle.platform.proto;
package phi.proto;
// (NOTE:zhouwei): ApiType describes which kind of external third party API
// More external third party API can be added.
......
......@@ -2,9 +2,12 @@ if(WITH_CUDNN_FRONTEND)
cc_library(
cache
SRCS cache.cc
DEPS cudnn-frontend)
DEPS cudnn-frontend phi_enforce)
else()
cc_library(cache SRCS cache.cc)
cc_library(
cache
SRCS cache.cc
DEPS phi_enforce)
endif()
cc_library(
switch_autotune
......
......@@ -14,7 +14,7 @@
#pragma once
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/core/errors.h"
namespace phi {
namespace funcs {
......
......@@ -18,7 +18,7 @@ limitations under the License. */
#include <string>
#include "paddle/fluid/platform/cpu_info.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
#ifdef PADDLE_WITH_MKLML
#include "paddle/phi/backends/dynload/mklml.h"
......
......@@ -15,9 +15,9 @@
#pragma once
#include <vector>
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/backends/dynload/cufft.h"
#include "paddle/phi/core/ddim.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/kernels/funcs/fft.h"
#include "paddle/phi/kernels/funcs/fft_key.h"
......
......@@ -12,7 +12,7 @@ limitations under the License. */
#pragma once
#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/kernels/funcs/detail/activation_functions.h"
namespace phi {
......
......@@ -15,8 +15,8 @@
#pragma once
#include <vector>
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/backends/dynload/hipfft.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/kernels/funcs/fft.h"
#include "paddle/phi/kernels/funcs/fft_key.h"
......
......@@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/kernels/funcs/detail/activation_functions.h"
namespace phi {
......
......@@ -21,8 +21,8 @@ limitations under the License. */
#include "paddle/fluid/framework/tensor.h"
#include "paddle/fluid/framework/tensor_util.h"
#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/core/utils/data_type.h"
#include "paddle/phi/kernels/funcs/eigen/common.h"
......
......@@ -15,10 +15,10 @@
#include "paddle/fluid/operators/layout_utils.h"
#include "paddle/fluid/operators/norm_utils.cu.h"
#include "paddle/fluid/platform/device/gpu/gpu_dnn.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/fluid/platform/flags.h"
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/layout.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/batch_norm_kernel.h"
#include "paddle/phi/kernels/empty_kernel.h"
......
......@@ -23,10 +23,10 @@ namespace cub = hipcub;
#include "paddle/fluid/operators/layout_utils.h"
#include "paddle/fluid/operators/norm_utils.cu.h"
#include "paddle/fluid/platform/device/gpu/gpu_dnn.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/fluid/platform/flags.h"
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/layout.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/batch_norm_kernel.h"
#include "paddle/phi/kernels/funcs/batch_norm_utils.h"
......
......@@ -15,10 +15,10 @@
#ifndef PADDLE_WITH_HIP
// HIP not support cusolver
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/backends/dynload/cusolver.h"
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/complex.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/funcs/lapack/lapack_function.h"
#include "paddle/phi/kernels/impl/cholesky_solve_kernel_impl.h"
......
......@@ -30,7 +30,7 @@ namespace cub = hipcub;
#include <random>
#include "paddle/fluid/framework/tensor_util.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/enforce.h"
#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL)
#include "paddle/fluid/distributed/collective/ProcessGroup.h"
......
......@@ -29,7 +29,7 @@ else
echo "please run on Mac/Linux"
exit 1
fi
protobuf/bin/protoc -I../../paddle/fluid/platform/ --python_out . ../../paddle/fluid/platform/external_error.proto
protobuf/bin/protoc -I../../paddle/phi/core/ --python_out . ../../paddle/phi/core/external_error.proto
python3.7 spider.py
tar czvf externalErrorMsg_$(date +'%Y%m%d').tar.gz externalErrorMsg.pb
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册