Wait for dependency in threadCb of each node.
By doing this, it will show more performance than before
because each node is performed in each thread context at the same time.
Change-Id: Ibbd1aafafa110957a0b75a39db78baf6f703b761
Signed-off-by: Inki Dae <inki.dae@samsung.com>
{
SINGLEO_LOGD("Launched node name = %s", node->getName().c_str());
+ // Wait until all nodes added to this node as dependency are completed
+ for (auto &d : node->getDependencies())
+ d->wait();
+
if (node->getType() == NodeType::INFERENCE) {
if (_inputs[0]->_data_type != DataType::IMAGE) {
SINGLEO_LOGE("Invalid input data type.");
n->setInputBuffer(inputBuffer);
}
- // Wait until all nodes added to this node as dependency are completed
- for (auto &d : n->getDependencies())
- d->wait();
-
threads.push_back(make_unique<thread>(&TaskManager::threadCb, this, std::ref(n)));
}