diff --git a/paddle/fluid/inference/tests/test_helper.h b/paddle/fluid/inference/tests/test_helper.h index d0688445fe642..0f5fe6d0aa9a5 100644 --- a/paddle/fluid/inference/tests/test_helper.h +++ b/paddle/fluid/inference/tests/test_helper.h @@ -110,6 +110,8 @@ void TestInference(const std::string& dirname, // Users can get the device_id using: // int device_id = place.GetDeviceId(); paddle::platform::SetDeviceId(0); +#else + PADDLE_THROW("'CUDAPlace' is not supported in CPU only device."); #endif }