|
ONE - On-device Neural Engine
|
#include <ThreadPool.h>
Public Member Functions | |
| ThreadPool (uint32_t num_threads=1) | |
| Coustruct ThreadPool object. | |
| ~ThreadPool () | |
| Destroy ThreadPool object. | |
| void | enqueue (std::unique_ptr< IFunction > &&fn) |
| Enqueue a function. | |
| uint32_t | numJobsInQueue () |
| Get number of jobs in worker's queue. | |
| void | finish () |
| Block until all jobs are finished. | |
Definition at line 29 of file ThreadPool.h.
| onert::exec::ThreadPool::ThreadPool | ( | uint32_t | num_threads = 1 | ) |
Coustruct ThreadPool object.
| num_threads | Number of threads |
Definition at line 24 of file ThreadPool.cc.
| onert::exec::ThreadPool::~ThreadPool | ( | ) |
Destroy ThreadPool object.
Definition at line 34 of file ThreadPool.cc.
References onert::exec::WorkQueue::terminate().
| void onert::exec::ThreadPool::enqueue | ( | std::unique_ptr< IFunction > && | fn | ) |
Enqueue a function.
| fn | A function to be queued |
Definition at line 43 of file ThreadPool.cc.
References onert::exec::WorkQueue::enqueue().
| void onert::exec::ThreadPool::finish | ( | ) |
Block until all jobs are finished.
Definition at line 56 of file ThreadPool.cc.
References onert::exec::WorkQueue::finish().
| uint32_t onert::exec::ThreadPool::numJobsInQueue | ( | ) |
Get number of jobs in worker's queue.
Definition at line 45 of file ThreadPool.cc.
References onert::exec::WorkQueue::numJobsInQueue().