5 #ifndef OPENCV_CORE_PARALLEL_FOR_OPENMP_HPP
6 #define OPENCV_CORE_PARALLEL_FOR_OPENMP_HPP
8 #include "opencv2/core/parallel/parallel_backend.hpp"
10 #if !defined(_OPENMP) && !defined(OPENCV_SKIP_OPENMP_PRESENSE_CHECK)
11 #error "This file must be compiled with enabled OpenMP"
16 namespace cv {
namespace parallel {
namespace openmp {
39 #pragma omp parallel for schedule(dynamic) num_threads(numThreads > 0 ? numThreads : numThreadsMax)
40 for (
int i = 0; i < tasks; ++i)
41 body_callback(i, i + 1, callback_data);
46 return omp_get_thread_num();
Definition: parallel_backend.hpp:57
void(CV_API_CALL * FN_parallel_for_body_cb_t)(int start, int end, void *data)
Definition: parallel_backend.hpp:61
Definition: parallel_for.openmp.hpp:24
virtual int setNumThreads(int nThreads) CV_OVERRIDE
Definition: parallel_for.openmp.hpp:56
ParallelForBackend()
Definition: parallel_for.openmp.hpp:29
virtual void parallel_for(int tasks, FN_parallel_for_body_cb_t body_callback, void *callback_data) CV_OVERRIDE
Definition: parallel_for.openmp.hpp:37
virtual ~ParallelForBackend()
Definition: parallel_for.openmp.hpp:35
const char * getName() const CV_OVERRIDE
Definition: parallel_for.openmp.hpp:64
virtual int getNumThreads() const CV_OVERRIDE
Definition: parallel_for.openmp.hpp:49
int numThreads
Definition: parallel_for.openmp.hpp:26
int numThreadsMax
Definition: parallel_for.openmp.hpp:27
virtual int getThreadNum() const CV_OVERRIDE
Definition: parallel_for.openmp.hpp:44
#define CV_OVERRIDE
Definition: cvdef.h:792
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441