OpenCV453
クラス | 関数
Parallel backends API

クラス

class  cv::parallel::openmp::ParallelForBackend
 
class  cv::parallel::tbb::ParallelForBackend
 
class  cv::parallel::ParallelForAPI
 

関数

CV_EXPORTS void cv::parallel::setParallelForBackend (const std::shared_ptr< ParallelForAPI > &api, bool propagateNumThreads=true)
 Replace OpenCV parallel_for backend [詳解]
 
CV_EXPORTS_W bool cv::parallel::setParallelForBackend (const std::string &backendName, bool propagateNumThreads=true)
 Change OpenCV parallel_for backend [詳解]
 

詳解

API below is provided to resolve problem of CPU resource over-subscription by multiple thread pools from different multi-threading frameworks. This is common problem for cases when OpenCV compiled threading framework is different from the Users Applications framework.

Applications can replace OpenCV parallel_for() backend with own implementation (to reuse Application's thread pool).

Backend API usage examples

Intel TBB

OpenMP

Plugins support

Runtime configuration options:

関数詳解

◆ setParallelForBackend() [1/2]

CV_EXPORTS void cv::parallel::setParallelForBackend ( const std::shared_ptr< ParallelForAPI > &  api,
bool  propagateNumThreads = true 
)

Replace OpenCV parallel_for backend

Application can replace OpenCV parallel_for() backend with own implementation.

覚え書き
This call is not thread-safe. Consider calling this function from the main() before any other OpenCV processing functions (and without any other created threads).

◆ setParallelForBackend() [2/2]

CV_EXPORTS_W bool cv::parallel::setParallelForBackend ( const std::string &  backendName,
bool  propagateNumThreads = true 
)

Change OpenCV parallel_for backend

覚え書き
This call is not thread-safe. Consider calling this function from the main() before any other OpenCV processing functions (and without any other created threads).