|
|
@ -215,6 +215,13 @@ void OpHandleBase::WaitInputVarGenerated(bool wait_for_feed) {
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
PADDLE_THROW(
|
|
|
|
PADDLE_THROW(
|
|
|
|
platform::errors::PreconditionNotMet("Not compiled with CUDA."));
|
|
|
|
platform::errors::PreconditionNotMet("Not compiled with CUDA."));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
} else if (platform::is_xpu_place(place)) {
|
|
|
|
|
|
|
|
#ifdef PADDLE_WITH_XPU
|
|
|
|
|
|
|
|
dev_ctxes_.at(place)->Wait();
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
PADDLE_THROW(
|
|
|
|
|
|
|
|
platform::errors::PreconditionNotMet("Not compiled with XPU."));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// There are nothing to do when the place is CPUPlace.
|
|
|
|
// There are nothing to do when the place is CPUPlace.
|
|
|
@ -264,6 +271,19 @@ void OpHandleBase::WaitInputVarGenerated(const platform::Place &place) {
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
PADDLE_THROW(
|
|
|
|
PADDLE_THROW(
|
|
|
|
platform::errors::PreconditionNotMet("Not compiled with CUDA."));
|
|
|
|
platform::errors::PreconditionNotMet("Not compiled with CUDA."));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
} else if (platform::is_xpu_place(in_var_handle->place())) {
|
|
|
|
|
|
|
|
#ifdef PADDLE_WITH_XPU
|
|
|
|
|
|
|
|
PADDLE_ENFORCE_EQ(
|
|
|
|
|
|
|
|
platform::is_same_place(place, in_var_handle->place()), true,
|
|
|
|
|
|
|
|
platform::errors::InvalidArgument(
|
|
|
|
|
|
|
|
"The place of output(%s) is not consistent with the "
|
|
|
|
|
|
|
|
"place of current op(%s).",
|
|
|
|
|
|
|
|
in_var_handle->Name(), Name()));
|
|
|
|
|
|
|
|
dev_ctxes_.at(place)->Wait();
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
PADDLE_THROW(
|
|
|
|
|
|
|
|
platform::errors::PreconditionNotMet("Not compiled with XPU."));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// There are nothing to do when the place is CPUPlace.
|
|
|
|
// There are nothing to do when the place is CPUPlace.
|
|
|
|