[][src]Function opencv::core::get_num_threads

pub fn get_num_threads() -> Result<i32>

Returns the number of threads used by OpenCV for parallel regions.

Always returns 1 if OpenCV is built without threading support.

The exact meaning of return value depends on the threading framework used by OpenCV library:

  • TBB - The number of threads, that OpenCV will try to use for parallel regions. If there is any tbb::thread_scheduler_init in user code conflicting with OpenCV, then function returns default number of threads used by TBB library.
  • OpenMP - An upper bound on the number of threads that could be used to form a new team.
  • Concurrency - The number of threads, that OpenCV will try to use for parallel regions.
  • GCD - Unsupported; returns the GCD thread pool limit (512) for compatibility.
  • C= - The number of threads, that OpenCV will try to use for parallel regions, if before called setNumThreads with threads > 0, otherwise returns the number of logical CPUs, available for the process.

See also

setNumThreads, getThreadNum