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

Method DevRun

executor/lib/node_dev_executor.cpp:127–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 */
126
127bool NodeExecutor::DevRun(void* graph_handle)
128{
129 NodeContext* context = reinterpret_cast<NodeContext*>(graph_handle);
130 Subgraph* graph = context->optimized_graph;
131 Node* node;
132
133 unsigned int i;
134 for(i = 0; i < graph->seq_nodes.size(); i++)
135 {
136 node = graph->seq_nodes[i];
137 node->SetNodeIndex(i);
138
139 if(node->ExistAttr("DEV_RUN"))
140 break;
141 }
142
143 if(i == graph->seq_nodes.size())
144 return true;
145
146 // set callback
147
148 auto f = std::bind(&NodeExecutor::OnNodeDone, this, context, std::placeholders::_1, std::placeholders::_2);
149
150 backend_dev_->SetNodeDoneHook(context->dev_context, dev_node_cb_t(f));
151
152 std::cout << "Run graph: " << graph->GetName() << " from node: " << node->GetName() << "\n";
153
154 if(worker_)
155 {
156 // push the node to worker
157 NodeTask task;
158 task.dev_context = context->dev_context;
159 task.node = node;
160
161 std::vector<NodeTask> list;
162
163 list.emplace_back(task);
164
165 worker_->PushTask(list);
166
167 return true;
168 }
169 else
170 {
171 return backend_dev_->Run(context->dev_context, node);
172 }
173}
174
175void NodeExecutor::ProcessTask(const NodeTask& task)
176{

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected