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

revert-23830-2.0-beta
Zhang Ting 6 years ago committed by GitHub
parent d349a622f0
commit 480530c4e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
}

Loading…
Cancel
Save