diff --git a/paddle/fluid/platform/profiler.cc b/paddle/fluid/platform/profiler.cc index 436654d1024a0bf72cb46d8a9d2650cf26f8f90e..28f93b4b1259e932ffdd2b5a124ccc4921ddd0f3 100644 --- a/paddle/fluid/platform/profiler.cc +++ b/paddle/fluid/platform/profiler.cc @@ -112,12 +112,11 @@ double Event::CpuElapsedMs(const Event& e) const { } double Event::CudaElapsedMs(const Event& e) const { -#ifdef PADDLE_WITH_CUDA #ifdef PADDLE_WITH_CUPTI return gpu_ns_ / 1000000.0; -#endif #else - PADDLE_THROW("CUDA is not enabled"); + LOG_FIRST_N(WARNING, 1) << "CUDA CUPTI is not enabled"; + return 0; #endif }