@@ -79,7 +79,7 @@ void OpHandleBase::InitCUDA() {
7979 auto *out_var_handle = dynamic_cast <VarHandle *>(out_var);
8080 if (out_var_handle) {
8181 PADDLE_ENFORCE_EQ (
82- platform ::is_same_place (place, out_var_handle->place ()),
82+ phi ::is_same_place (place, out_var_handle->place ()),
8383 true ,
8484 platform::errors::InvalidArgument (
8585 " The place of output(%s) is not consistent with the "
@@ -118,7 +118,7 @@ void OpHandleBase::InitXPU() {
118118 auto *out_var_handle = dynamic_cast <VarHandle *>(out_var);
119119 if (out_var_handle) {
120120 PADDLE_ENFORCE_EQ (
121- platform ::is_same_place (place, out_var_handle->place ()),
121+ phi ::is_same_place (place, out_var_handle->place ()),
122122 true ,
123123 platform::errors::InvalidArgument (
124124 " The place of output(%s) is not consistent with the "
@@ -176,7 +176,7 @@ void OpHandleBase::RecordWaitEventOnCtx(platform::DeviceContext *waited_ctx) {
176176 PADDLE_ENFORCE_NOT_NULL (
177177 waited_ctx,
178178 platform::errors::InvalidArgument (" Argument waited_ctx is NULL." ));
179- if (platform ::is_cpu_place (waited_ctx->GetPlace ()) || events_.empty ()) {
179+ if (phi ::is_cpu_place (waited_ctx->GetPlace ()) || events_.empty ()) {
180180 for (auto &dev_ctx : dev_ctxes_) {
181181 PADDLE_ENFORCE_NOT_NULL (
182182 dev_ctx.second ,
@@ -220,7 +220,7 @@ void OpHandleBase::WaitInputVarGenerated(bool wait_for_feed) {
220220 auto *in_var_handle = dynamic_cast <VarHandle *>(in_var);
221221 if (in_var_handle) {
222222 auto &place = in_var_handle->place ();
223- if (platform ::is_gpu_place (place)) {
223+ if (phi ::is_gpu_place (place)) {
224224#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
225225 auto stream =
226226 static_cast <phi::GPUContext *>(dev_ctxes_.at (place))->stream ();
@@ -247,10 +247,9 @@ void OpHandleBase::WaitInputVarGenerated(bool wait_for_feed) {
247247 auto *in_var_handle = dynamic_cast <VarHandle *>(in_var);
248248 if (in_var_handle) {
249249 auto &place = in_var_handle->place ();
250- if (platform ::is_gpu_place (place)) {
250+ if (phi ::is_gpu_place (place)) {
251251#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
252- platform::DeviceContextPool &pool =
253- platform::DeviceContextPool::Instance ();
252+ phi::DeviceContextPool &pool = phi::DeviceContextPool::Instance ();
254253 auto stream =
255254 static_cast <phi::GPUContext *>(pool.Get (place))->stream ();
256255 platform::GpuStreamSync (stream);
@@ -272,7 +271,7 @@ void OpHandleBase::WaitInputVarGenerated(const phi::Place &place) {
272271 // so there doesn't add event for it.
273272 auto *in_var_handle = dynamic_cast <VarHandle *>(in_var);
274273 if (in_var_handle) {
275- if (platform ::is_gpu_place (in_var_handle->place ())) {
274+ if (phi ::is_gpu_place (in_var_handle->place ())) {
276275#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
277276 auto stream = static_cast <phi::GPUContext *>(
278277 dev_ctxes_.at (in_var_handle->place ()))
@@ -332,7 +331,7 @@ void OpHandleBase::RunAndRecordEvent(const std::function<void()> &callback) {
332331void OpHandleBase::RunAndRecordEvent (phi::Place p,
333332 const std::function<void ()> &callback) {
334333#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
335- if (platform ::is_cpu_place (p) || events_.empty ()) {
334+ if (phi ::is_cpu_place (p) || events_.empty ()) {
336335 callback ();
337336 } else {
338337 auto *ctx = dev_ctxes_.at (p);
0 commit comments