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

Method GetOptimizedGraph

executor/lib/graph_task.cpp:181–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181Graph* GraphTask::GetOptimizedGraph(void)
182{
183 std::vector<Subgraph*> sub_list;
184
185 for(auto e : sub_task_list_)
186 {
187 if(!e->graph_optimized)
188 {
189 sub_list.push_back(e->sub_graph);
190 continue;
191 }
192
193 DevExecutor* dev_executor = e->dev_executor;
194
195 Subgraph* sub_graph = dev_executor->GetOptimizedGraph(e);
196
197 sub_list.push_back(sub_graph);
198 }
199
200 if(sub_list.empty())
201 {
202 return nullptr;
203 }
204
205 if(optimized_graph_)
206 delete optimized_graph_;
207
208 optimized_graph_ = MergeSubgraph(graph_, sub_list);
209
210 optimized_graph_->SetLayout(graph_->GetLayout());
211 optimized_graph_->SetModelLayout(graph_->GetModelLayout());
212 optimized_graph_->SetModelFormat(graph_->GetModelFormat());
213 optimized_graph_->SetModelSubFormat(graph_->GetModelSubFormat());
214
215 return optimized_graph_;
216}
217
218bool GraphTask::SetEventHook(int event, event_handler_t cb_func, void* cb_arg)
219{

Callers

nothing calls this directly

Calls 9

emptyMethod · 0.80
SetLayoutMethod · 0.80
GetLayoutMethod · 0.80
SetModelLayoutMethod · 0.80
GetModelLayoutMethod · 0.80
SetModelFormatMethod · 0.80
GetModelFormatMethod · 0.80
SetModelSubFormatMethod · 0.80
GetModelSubFormatMethod · 0.80

Tested by

no test coverage detected