JeVois
1.22
JeVois Smart Embedded Machine Vision Toolkit
|
|
#include <jevois/Util/ThreadPool.H>
A parallel API to make OpenCV use our thread pool.
The goal is to avoid over-subscribing our cores by having several disjoint parallelization mechanisms: our JeVois ThreadPool, and OpenCV's parallel_for backend (which may be TBB, OpenMP, etc). We can also enforce here that OpenCV tasks will only run on big cores, while the default OpenCV behavior is to use all cores. This can lead to bad delays if little A53 cores are chosen for tome tasks, as they are much slower than the big A73 cores.
Definition at line 79 of file ThreadPool.H.
Public Member Functions | |
ParallelForAPIjevois (ThreadPool *tp) | |
Constructor from an existing ThreadPool. | |
virtual | ~ParallelForAPIjevois () |
Virtual destructor for save inheritance. | |
virtual void | parallel_for (int tasks, cv::parallel::ParallelForAPI::FN_parallel_for_body_cb_t body_callback, void *callback_data) override |
Run a parallelized OpenCV task. | |
virtual int | getThreadNum () const override |
Get some index for the current thread. | |
virtual int | getNumThreads () const override |
Get number of threads for concurrency (always 4 on JeVois-Pro, unless changed by setNumThreads() here) | |
virtual int | setNumThreads (int nThreads) override |
Set number of threads for OpenCV. NOTE: currently does nothing, we always use 4 big A73 threads. | |
virtual char const * | getName () const override |
Get the name: 'jevois'. | |
Protected Attributes | |
ThreadPool * | itsThreadpool |
int | itsNumThreads |
jevois::ParallelForAPIjevois::ParallelForAPIjevois | ( | jevois::ThreadPool * | tp | ) |
Constructor from an existing ThreadPool.
Definition at line 126 of file ThreadPool.C.
|
virtual |
Virtual destructor for save inheritance.
Definition at line 130 of file ThreadPool.C.
|
overridevirtual |
Get the name: 'jevois'.
Definition at line 173 of file ThreadPool.C.
|
overridevirtual |
Get number of threads for concurrency (always 4 on JeVois-Pro, unless changed by setNumThreads() here)
Definition at line 161 of file ThreadPool.C.
|
overridevirtual |
Get some index for the current thread.
Definition at line 155 of file ThreadPool.C.
|
overridevirtual |
Run a parallelized OpenCV task.
Definition at line 134 of file ThreadPool.C.
References jevois::joinall(), and LDEBUG.
|
overridevirtual |
Set number of threads for OpenCV. NOTE: currently does nothing, we always use 4 big A73 threads.
Definition at line 165 of file ThreadPool.C.
References LERROR.
|
protected |
Definition at line 108 of file ThreadPool.H.
|
protected |
Definition at line 107 of file ThreadPool.H.