task_manager: fix output function of task manager 64/315364/3
authorInki Dae <inki.dae@samsung.com>
Fri, 29 Nov 2024 07:34:42 +0000 (16:34 +0900)
committerInki Dae <inki.dae@samsung.com>
Wed, 4 Dec 2024 06:26:43 +0000 (06:26 +0000)
Fix output function of task manager. Without topological sorting,
endpoint node couldn't be positioned as last node of pipeline,
and it results in losting result value from inference node because
node.back() couldn't be endpoint node. So find endpoint node from
the pipeline(_nodes) and get the result from the endpoint node.

Change-Id: I697732527b6fb44afec873c329cc0f441b3e6ee3
Signed-off-by: Inki Dae <inki.dae@samsung.com>
services/task_manager/src/TaskManager.cpp

index 7039306c97d136e3f804ce18da8c4181ab183f32..9c18fb93f5493ca89e3a8973332109d6ad1dff0e 100644 (file)
@@ -345,7 +345,12 @@ vector<shared_ptr<BaseResultType> > &TaskManager::output()
        }
 
        _results.clear();
-       _results = _nodes.back()->results();
+       for (auto &node : _nodes) {
+               if (node->getType() == NodeType::ENDPOINT) {
+                       _results = node->results();
+                       break;
+               }
+       }
 
        return _results;
 }