[neurun] Always notify ExecutionObserver (#5958)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 29 Jul 2019 06:12:12 +0000 (15:12 +0900)
committer이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Mon, 29 Jul 2019 06:12:12 +0000 (15:12 +0900)
Now, DataflowExecutor notifies the beginning and end of the whole
execution whenever any observer exists (even when profiling mode is
disabled).

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
runtimes/neurun/core/src/exec/DataflowExecutor.cc

index 7f6b132..06dfd59 100644 (file)
@@ -143,7 +143,7 @@ void DataflowExecutor::executeImpl()
   }
   assert(!_ready_jobs.empty()); // Cannot begin if there is no initial jobs
   bool is_profiling = util::getConfigBool(util::config::PROFILING_MODE);
-  if (is_profiling)
+  // TODO Fix indentation
   {
     // Notifiy Execution Begin
     for (auto &o : _observers)
@@ -151,6 +151,7 @@ void DataflowExecutor::executeImpl()
       o->handleBegin(this);
     }
   }
+
   while (!_ready_jobs.empty())
   {
     auto job = std::move((_ready_jobs.begin())->second);
@@ -167,7 +168,7 @@ void DataflowExecutor::executeImpl()
     _finished_jobs[job_index] = std::move(job);
   }
   assert(noWaitingJobs());
-  if (is_profiling)
+  // TODO Fix indentation
   {
     for (auto &o : _observers)
     {