diff --git a/paddle/fluid/platform/place.h b/paddle/fluid/platform/place.h index 4e7e157e3e2b4c021b5f09d3483bf41782a5ae8d..eeda10a633b655dee0da9197888738cd94b50809 100644 --- a/paddle/fluid/platform/place.h +++ b/paddle/fluid/platform/place.h @@ -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 }