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

Method RunTask

executor/lib/generic_dev_executor.cpp:291–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291bool GenericDevExecutor::RunTask(SubgraphTask* task)
292{
293 // return true: accepted running
294 // return false: try again
295
296 if(DevGetStatus() != kDevNormal)
297 {
298 task->SetStatus(EXEC_STATUS_READY);
299 InsertQueue(task);
300 return false;
301 }
302
303 if(SupportNonblockRun())
304 {
305 task->Lock(); // protect with OnSubgraphDone()
306
307 bool ret = DevRun(task->graph_handle);
308
309 if(ret)
310 task->SetStatus(EXEC_STATUS_RUN);
311 else
312 task->SetStatus(EXEC_STATUS_READY);
313
314 InsertQueue(task);
315
316 task->Unlock();
317
318 return ret;
319 }
320 else
321 {
322 task->Lock(); // protect with Postrun()
323
324 bool ret = DevSyncRun(task->graph_handle);
325
326 task->SetStatus(EXEC_STATUS_WAIT);
327
328 InsertQueue(kWaitQueue, task);
329
330 task->OnTaskDone(ret);
331
332 task->Unlock();
333
334 return ret;
335 }
336}
337
338bool GenericDevExecutor::PostrunTask(SubgraphTask* task)
339{

Callers

nothing calls this directly

Calls 4

SetStatusMethod · 0.80
OnTaskDoneMethod · 0.80
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected