MCPcopy Create free account
hub / github.com/OAID/Tengine / OnNodeDone

Method OnNodeDone

executor/lib/node_dev_executor.cpp:180–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180void NodeExecutor::OnNodeDone(NodeContext* context, Node* node, bool exec_success)
181{
182 Subgraph* graph = context->optimized_graph;
183
184 if(!exec_success)
185 {
186 OnSubgraphDone(graph, false);
187
188 return;
189 }
190
191 std::cout << "node " << node->GetName() << " is done\n";
192 // search next node to run
193
194 unsigned int idx = node->GetNodeIndex();
195
196 Node* next_node = nullptr;
197
198 for(idx++; idx < graph->seq_nodes.size(); idx++)
199 {
200 next_node = graph->seq_nodes[idx];
201 next_node->SetNodeIndex(idx);
202
203 if(next_node->ExistAttr("DEV_RUN"))
204 break;
205 }
206
207 if(idx < graph->seq_nodes.size())
208 {
209 std::cout << "issue node: " << next_node->GetName() << " to run\n";
210
211 if(worker_)
212 {
213 NodeTask task;
214
215 task.dev_context = context->dev_context;
216 task.node = next_node;
217
218 std::vector<NodeTask> list;
219
220 list.emplace_back(task);
221
222 worker_->PushTask(list);
223 }
224 else
225 {
226 backend_dev_->Run(context->dev_context, next_node);
227 }
228 }
229 else
230 {
231 std::cout << "graph " << graph->GetName() << " is done\n";
232 OnSubgraphDone(graph, true);
233 }
234}
235
236bool NodeExecutor::DevSyncRun(void* graph_handle)
237{

Callers

nothing calls this directly

Calls 7

GetNameMethod · 0.80
GetNodeIndexMethod · 0.80
SetNodeIndexMethod · 0.80
sizeMethod · 0.45
ExistAttrMethod · 0.45
PushTaskMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected