ONE - On-device Neural Engine
|
#include <WorkQueue.h>
Public Types | |
enum class | State { ONLINE , FINISHING , FORCE_FINISHING } |
Public Member Functions | |
WorkQueue ()=default | |
Create WorkQueue object. | |
~WorkQueue () | |
Destroy WorkQueue object. | |
void | operator() () |
Thread entry function. | |
void | enqueue (std::unique_ptr< IFunction > &&fn) |
Push the given Task to the job queue. | |
void | terminate () |
Flag as terminating so all the worker threads can terminate. | |
void | finish () |
Flag as terminating so all the worker threads can terminate. | |
uint32_t | numJobsInQueue () |
Check if it has pending jobs. Even if this returns fals, WorkQueue threads may be still running. | |
Definition at line 32 of file WorkQueue.h.
|
strong |
Enumerator | |
---|---|
ONLINE | |
FINISHING | |
FORCE_FINISHING |
Definition at line 35 of file WorkQueue.h.
|
default |
Create WorkQueue object.
onert::exec::WorkQueue::~WorkQueue | ( | ) |
Destroy WorkQueue object.
Definition at line 26 of file WorkQueue.cc.
References FORCE_FINISHING.
void onert::exec::WorkQueue::enqueue | ( | std::unique_ptr< IFunction > && | fn | ) |
Push the given Task to the job queue.
fn | Function to be executed(a job) |
Definition at line 70 of file WorkQueue.cc.
Referenced by onert::exec::ThreadPool::enqueue().
void onert::exec::WorkQueue::finish | ( | ) |
Flag as terminating so all the worker threads can terminate.
Definition at line 88 of file WorkQueue.cc.
References FINISHING.
Referenced by onert::exec::ThreadPool::finish().
uint32_t onert::exec::WorkQueue::numJobsInQueue | ( | ) |
Check if it has pending jobs. Even if this returns fals, WorkQueue threads may be still running.
Definition at line 97 of file WorkQueue.cc.
Referenced by onert::exec::ThreadPool::numJobsInQueue().
void onert::exec::WorkQueue::operator() | ( | ) |
Thread entry function.
Definition at line 35 of file WorkQueue.cc.
References FINISHING, FORCE_FINISHING, and ONLINE.
void onert::exec::WorkQueue::terminate | ( | ) |
Flag as terminating so all the worker threads can terminate.
Definition at line 79 of file WorkQueue.cc.
References FORCE_FINISHING.
Referenced by onert::exec::ThreadPool::~ThreadPool().