未验证 提交 932aca16 编写于 作者: W wangchaochaohu 提交者: GitHub

Add Branch to avoid CPU profiler warning print (#21556)


* fix profiler warning message in cpu profile mode test=develop
上级 cdd46d7e
......@@ -472,7 +472,10 @@ void ParseEvents(const std::vector<std::vector<Event>> &events,
if (rit != pushed_events.rend()) {
double event_time = 0;
double gpu_time = rit->CudaElapsedMs((*analyze_events)[i][j]);
double gpu_time = 0.0f;
#ifdef PADDLE_WITH_CUDA
gpu_time = rit->CudaElapsedMs((*analyze_events)[i][j]);
#endif
double cpu_time = rit->CpuElapsedMs((*analyze_events)[i][j]);
if (g_state == ProfilerState::kCUDA) {
event_time = gpu_time;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册