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

Method Prerun

driver/cpu/cpu_runner.cpp:237–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235bool debug_graph = false;
236
237bool CPURunner::Prerun(Subgraph* sub_graph)
238{
239 if(!BindNodeOps(sub_graph))
240 return false;
241
242 if(!AllocateMem(sub_graph))
243 return false;
244
245 for(unsigned int i = 0; i < sub_graph->seq_nodes.size(); i++)
246 {
247 Node* node = sub_graph->seq_nodes[i];
248
249 if(!node->ExistAttr(ATTR_NODE_OPS))
250 continue;
251
252 NodeOps* node_ops = any_cast<NodeOps*>(node->GetAttr(ATTR_NODE_OPS));
253
254 if(!node_ops->Prerun(node))
255 {
256 XLOG_ERROR() << "Prerun for node: " << node->GetName() << " op: " << node->GetOp()->GetName() << " failed\n";
257 return false;
258 }
259 }
260
261 return true;
262}
263
264#ifdef ENABLE_TIME_PROFILING
265

Callers 5

test_new_operatorFunction · 0.45
test_new_operatorFunction · 0.45
test_mt_modeFunction · 0.45
test_st_modeFunction · 0.45
DevPrerunMethod · 0.45

Calls 5

GetNameMethod · 0.80
GetOpMethod · 0.80
sizeMethod · 0.45
ExistAttrMethod · 0.45
GetAttrMethod · 0.45

Tested by 4

test_new_operatorFunction · 0.36
test_new_operatorFunction · 0.36
test_mt_modeFunction · 0.36
test_st_modeFunction · 0.36