diff --git a/paddle/phi/backends/callback_manager.cc b/paddle/phi/backends/callback_manager.cc index c996b8d9befa99ad5f474f90a27f5e92f6585d20..0d658258fa4c056d0c6df5f0104e08004df41001 100644 --- a/paddle/phi/backends/callback_manager.cc +++ b/paddle/phi/backends/callback_manager.cc @@ -16,7 +16,6 @@ #include -#include "paddle/fluid/platform/device/device_wrapper.h" #include "paddle/phi/backends/device_guard.h" #include "paddle/phi/core/enforce.h" diff --git a/paddle/phi/backends/event.cc b/paddle/phi/backends/event.cc index 7d87318cfec5585533244e3b502d25bbc7303167..7e64bc58fdbbf8e6057a8b8e1106d4edc60b8fc0 100644 --- a/paddle/phi/backends/event.cc +++ b/paddle/phi/backends/event.cc @@ -14,7 +14,6 @@ #include "paddle/phi/backends/event.h" -#include "paddle/fluid/platform/device/device_wrapper.h" #include "paddle/phi/backends/device_guard.h" #include "paddle/phi/backends/stream.h" diff --git a/paddle/phi/backends/stream.cc b/paddle/phi/backends/stream.cc index 729f5717a5fd7367c4c608aadebc44a5713a5b18..097f44264580c36da280bac3ed3030765d434c5e 100644 --- a/paddle/phi/backends/stream.cc +++ b/paddle/phi/backends/stream.cc @@ -14,7 +14,6 @@ #include "paddle/phi/backends/stream.h" -#include "paddle/fluid/platform/device/device_wrapper.h" #include "paddle/phi/backends/device_guard.h" #include "paddle/phi/backends/event.h" diff --git a/paddle/phi/kernels/funcs/selected_rows_functor.cc b/paddle/phi/kernels/funcs/selected_rows_functor.cc index e2a3513a428dc41165e7150ebae75778094fc28a..1557c3dee3dbf346046cf71cbbf5b5424ad4f6b0 100644 --- a/paddle/phi/kernels/funcs/selected_rows_functor.cc +++ b/paddle/phi/kernels/funcs/selected_rows_functor.cc @@ -14,9 +14,12 @@ limitations under the License. */ #include "paddle/phi/kernels/funcs/selected_rows_functor.h" -#include "paddle/fluid/platform/device/device_wrapper.h" #include "paddle/phi/core/mixed_vector.h" +#ifdef PADDLE_WITH_XPU +#include "paddle/phi/backends/xpu/enforce_xpu.h" +#endif + #ifdef PADDLE_WITH_MKLDNN #include "paddle/phi/backends/onednn/axpy_handler.h" #endif @@ -73,17 +76,17 @@ struct SelectedRowsAdd { out_value->numel() / out_rows.size())); auto in1_place = input1.place(); - PADDLE_ENFORCE_EQ(paddle::platform::is_cpu_place(in1_place), + PADDLE_ENFORCE_EQ(in1_place.GetType() == phi::AllocationType::CPU, true, phi::errors::InvalidArgument( "The running environment is not on the CPU place.")); auto in2_place = input2.place(); - PADDLE_ENFORCE_EQ(paddle::platform::is_cpu_place(in2_place), + PADDLE_ENFORCE_EQ(in2_place.GetType() == phi::AllocationType::CPU, true, phi::errors::InvalidArgument( "The running environment is not on the CPU place.")); auto out_place = context.GetPlace(); - PADDLE_ENFORCE_EQ(paddle::platform::is_cpu_place(out_place), + PADDLE_ENFORCE_EQ(out_place.GetType() == phi::AllocationType::CPU, true, phi::errors::InvalidArgument( "The running environment is not on the CPU place.")); @@ -204,12 +207,12 @@ struct SelectedRowsAddTo { mixv_in2_rows.Extend(in1_rows.begin(), in1_rows.end()); auto in1_place = input1.place(); - PADDLE_ENFORCE_EQ(paddle::platform::is_cpu_place(in1_place), + PADDLE_ENFORCE_EQ(in1_place.GetType() == phi::AllocationType::CPU, true, phi::errors::InvalidArgument( "The running environment is not on the CPU place.")); auto in2_place = input2->place(); - PADDLE_ENFORCE_EQ(paddle::platform::is_cpu_place(in2_place), + PADDLE_ENFORCE_EQ(in2_place.GetType() == phi::AllocationType::CPU, true, phi::errors::InvalidArgument( "The running environment is not on the CPU place."));