From 01ee42b121b8226cae28630356a7dee5d30fbaf0 Mon Sep 17 00:00:00 2001 From: Luo Tao Date: Mon, 8 Jan 2018 15:11:50 +0800 Subject: [PATCH] fix compile error in profiler.cc --- paddle/platform/profiler.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/paddle/platform/profiler.cc b/paddle/platform/profiler.cc index 4283724d2..7e2e2d968 100644 --- a/paddle/platform/profiler.cc +++ b/paddle/platform/profiler.cc @@ -183,35 +183,35 @@ void ParseEvents(std::vector>& events, if (g_profiler_place == "") return; std::string sorted_domain; - std::function sorted_func; + std::function sorted_func; switch (sorted_by) { case EventSortingKey::kCalls: sorted_domain = "number of calls"; - sorted_func = [](EventItem& a, EventItem& b) { + sorted_func = [](const EventItem& a, const EventItem& b) { return a.calls > b.calls; }; break; case EventSortingKey::kTotal: sorted_domain = "total time"; - sorted_func = [](EventItem& a, EventItem& b) { + sorted_func = [](const EventItem& a, const EventItem& b) { return a.total_time > b.total_time; }; break; case EventSortingKey::kMin: sorted_domain = "minimum time"; - sorted_func = [](EventItem& a, EventItem& b) { + sorted_func = [](const EventItem& a, const EventItem& b) { return a.min_time > b.min_time; }; break; case EventSortingKey::kMax: sorted_domain = "maximum time"; - sorted_func = [](EventItem& a, EventItem& b) { + sorted_func = [](const EventItem& a, const EventItem& b) { return a.max_time > b.max_time; }; break; case EventSortingKey::kAve: sorted_domain = "average time"; - sorted_func = [](EventItem& a, EventItem& b) { + sorted_func = [](const EventItem& a, const EventItem& b) { return a.ave_time > b.ave_time; }; break; -- GitLab