未验证 提交 d90469a4 编写于 作者: H houj04 提交者: GitHub

fix xpu compile on phi::enforce. (#48345)

上级 080349cd
...@@ -27,7 +27,7 @@ bool CheckXPUStatusFailure(T value, const std::string& msg) { ...@@ -27,7 +27,7 @@ bool CheckXPUStatusFailure(T value, const std::string& msg) {
try { try {
PADDLE_ENFORCE_XPU_SUCCESS(value); PADDLE_ENFORCE_XPU_SUCCESS(value);
return false; return false;
} catch (paddle::platform::EnforceNotMet& error) { } catch (phi::enforce::EnforceNotMet& error) {
std::string ex_msg = error.what(); std::string ex_msg = error.what();
std::cout << ex_msg << std::endl; std::cout << ex_msg << std::endl;
return ex_msg.find(msg) != std::string::npos; return ex_msg.find(msg) != std::string::npos;
...@@ -45,7 +45,7 @@ bool CheckXDNNStatusFailure(T value, const std::string& msg) { ...@@ -45,7 +45,7 @@ bool CheckXDNNStatusFailure(T value, const std::string& msg) {
try { try {
PADDLE_ENFORCE_XDNN_SUCCESS(value, "XDNN Error "); PADDLE_ENFORCE_XDNN_SUCCESS(value, "XDNN Error ");
return false; return false;
} catch (paddle::platform::EnforceNotMet& error) { } catch (phi::enforce::EnforceNotMet& error) {
std::string ex_msg = error.what(); std::string ex_msg = error.what();
std::cout << ex_msg << std::endl; std::cout << ex_msg << std::endl;
return ex_msg.find(msg) != std::string::npos; return ex_msg.find(msg) != std::string::npos;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册