From a4f019e79d980391c05903394cf5f67e11f77bef Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Wed, 15 Jun 2022 11:28:34 +0800 Subject: [PATCH] fix(mgb/atlas): fix issue with profiling on Atlas GitOrigin-RevId: fbae81940de3a33b329ddb7f2bc9514e9af2fd66 --- src/plugin/impl/profiler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugin/impl/profiler.cpp b/src/plugin/impl/profiler.cpp index 418083387..f9f2501b5 100644 --- a/src/plugin/impl/profiler.cpp +++ b/src/plugin/impl/profiler.cpp @@ -157,6 +157,12 @@ std::shared_ptr GraphProfiler::to_json() const { auto&& event = kern_ev.second; auto&& start = m_start_of_time->at(comp_node); event.end->host_wait(); + //! every event needs to be synchronized on the atlas to ensure that the event + //! completes ??? +#if MGB_ATLAS + event.kern->host_wait(); + event.start->host_wait(); +#endif opr_prof[comp_node.to_string()] = Object::make({ {"start", Number::make(start->elapsed_time_until(*event.start))}, {"kern", Number::make(start->elapsed_time_until(*event.kern))}, -- GitLab