未验证 提交 8e3e65ff 编写于 作者: X Xin Pan 提交者: GitHub

Merge pull request #10526 from panyx0718/infer_profile2

allow inference test to generate timeline
...@@ -149,7 +149,7 @@ void TestInference(const std::string& dirname, ...@@ -149,7 +149,7 @@ void TestInference(const std::string& dirname,
state = paddle::platform::ProfilerState::kCPU; state = paddle::platform::ProfilerState::kCPU;
} else { } else {
#ifdef PADDLE_WITH_CUDA #ifdef PADDLE_WITH_CUDA
state = paddle::platform::ProfilerState::kCUDA; state = paddle::platform::ProfilerState::kAll;
// The default device_id of paddle::platform::CUDAPlace is 0. // The default device_id of paddle::platform::CUDAPlace is 0.
// Users can get the device_id using: // Users can get the device_id using:
// int device_id = place.GetDeviceId(); // int device_id = place.GetDeviceId();
...@@ -172,7 +172,7 @@ void TestInference(const std::string& dirname, ...@@ -172,7 +172,7 @@ void TestInference(const std::string& dirname,
} }
// Disable the profiler and print the timing information // Disable the profiler and print the timing information
paddle::platform::DisableProfiler(paddle::platform::EventSortingKey::kDefault, paddle::platform::DisableProfiler(paddle::platform::EventSortingKey::kDefault,
"load_program_profiler.txt"); "load_program_profiler");
paddle::platform::ResetProfiler(); paddle::platform::ResetProfiler();
// 3. Get the feed_target_names and fetch_target_names // 3. Get the feed_target_names and fetch_target_names
...@@ -237,7 +237,7 @@ void TestInference(const std::string& dirname, ...@@ -237,7 +237,7 @@ void TestInference(const std::string& dirname,
// Disable the profiler and print the timing information // Disable the profiler and print the timing information
paddle::platform::DisableProfiler( paddle::platform::DisableProfiler(
paddle::platform::EventSortingKey::kDefault, paddle::platform::EventSortingKey::kDefault,
"run_inference_profiler.txt"); "run_inference_profiler");
paddle::platform::ResetProfiler(); paddle::platform::ResetProfiler();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册