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

Method PrepareExec

core/lib/graph_executor.cpp:71–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71bool GraphExecutor::PrepareExec(void* exec_context, Graph* graph, StaticGraph* static_graph)
72{
73 std::string exec_engine_name;
74
75 TEngineConfig::Get("exec.engine", exec_engine_name);
76
77 if(!ExecEngineManager::SafeGet(exec_engine_name, exec_engine_))
78 {
79 LOG_ERROR() << "No executor engine registered with name: " << exec_engine_name << "\n";
80 set_tengine_errno(ENODEV);
81 return false;
82 }
83
84 exec_handle_ = exec_engine_->AddGraphExecutor(this);
85
86 if(exec_handle_ == nullptr)
87 {
88 set_tengine_errno(EFAULT);
89 return false;
90 }
91
92 if(static_graph != nullptr)
93 {
94 /* set dev handle */
95 exec_attr_.dev_handle = static_graph->dev_handle;
96
97 if(exec_context != static_graph->exec_context)
98 {
99 XLOG_INFO() << "create runtime graph from different context model\n";
100 }
101 }
102
103 exec_attr_.exec_context = exec_context;
104
105 return true;
106}
107
108bool GraphExecutor::SetExecParam(Graph* graph)
109{

Callers

nothing calls this directly

Calls 2

set_tengine_errnoFunction · 0.85
AddGraphExecutorMethod · 0.80

Tested by

no test coverage detected