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

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

上级 d349a622
......@@ -119,7 +119,8 @@ struct PlaceVisitorWrapper
#ifdef PADDLE_WITH_CUDA
return visitor_(cuda);
#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();
#endif
}
......@@ -129,7 +130,8 @@ struct PlaceVisitorWrapper
#ifdef PADDLE_WITH_CUDA
return visitor_(cuda_pinned);
#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();
#endif
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册