未验证 提交 480530c4 编写于 作者: Z Zhang Ting 提交者: GitHub

API(place-related) error message enhancement (#23515)

上级 d349a622
...@@ -119,7 +119,8 @@ struct PlaceVisitorWrapper ...@@ -119,7 +119,8 @@ struct PlaceVisitorWrapper
#ifdef PADDLE_WITH_CUDA #ifdef PADDLE_WITH_CUDA
return visitor_(cuda); return visitor_(cuda);
#else #else
PADDLE_THROW("Paddle is not compiled with CUDA. Cannot visit cuda device"); PADDLE_THROW(platform::errors::Unavailable(
"Paddle is not compiled with CUDA. Cannot visit cuda device"));
return typename Visitor::result_type(); return typename Visitor::result_type();
#endif #endif
} }
...@@ -129,7 +130,8 @@ struct PlaceVisitorWrapper ...@@ -129,7 +130,8 @@ struct PlaceVisitorWrapper
#ifdef PADDLE_WITH_CUDA #ifdef PADDLE_WITH_CUDA
return visitor_(cuda_pinned); return visitor_(cuda_pinned);
#else #else
PADDLE_THROW("Paddle is not compiled with CUDA. Cannot visit cuda_pinned"); PADDLE_THROW(platform::errors::Unavailable(
"Paddle is not compiled with CUDA. Cannot visit cuda_pinned"));
return typename Visitor::result_type(); return typename Visitor::result_type();
#endif #endif
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册