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

Method Run

executor/lib/graph_task.cpp:314–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314bool GraphTask::Run(exec_event_t& event)
315{
316 wait_event_.mutex.lock();
317
318 if(status_ != EXEC_STATUS_INITED && status_ != EXEC_STATUS_READY)
319 {
320 XLOG_ERROR() << "bad status: " << dev_engine_->GetStatusStr(status_) << "\n";
321 wait_event_.mutex.unlock();
322 return false;
323 }
324
325 /* inital status */
326 status_ = EXEC_STATUS_RUN;
327 wait_event_.mutex.unlock();
328
329 output_wait_count_ = output_task_number_;
330 active_sub_task_count_ = 0;
331 task_done_ = false;
332
333 wait_event_.wait_count = 0;
334 int task_launched = 0;
335
336 // let all input tasks run
337 for(auto e : sub_task_list_)
338 {
339 if(!e->saved_input_wait_count_)
340 {
341 if(RunSubgraphTask(e))
342 task_launched++;
343 else
344 {
345 XLOG_ERROR() << "failed to run task on dev executor: " << e->dev_executor->GetName() << "\n";
346 status_ = EXEC_STATUS_BAD;
347 break;
348 }
349 }
350 }
351
352 if(!task_launched)
353 {
354 XLOG_ERROR() << "No sub task launched!!\n";
355
356 status_ = EXEC_STATUS_BAD;
357 }
358
359 if(status_ == EXEC_STATUS_BAD)
360 return false;
361
362 event = &wait_event_;
363
364 return true;
365}
366
367bool GraphTask::SetCallback(exec_event_t& e, int event, exec_cb_t cb)
368{

Callers 3

DevRunMethod · 0.45
ProcessTaskMethod · 0.45
OnNodeDoneMethod · 0.45

Calls 1

GetNameMethod · 0.80

Tested by

no test coverage detected