Ask Your Question
3

Where is OpenMP used in OpenCV?

asked 2014-05-27 03:36:58 -0600

Wilds gravatar image

If OpenMP is build into the libraries is it used somewhere in the libraries? Is there a list to see which algorithms have parallel versions?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2014-05-28 03:17:08 -0600

Guanta gravatar image

As far as I understood it, OpenCV encapsulates libraries like OpenMP and TBB (see modules/core/src/parallel.cpp), so any method which uses parallel_for_ can make use of OpenMP (note: if TBB is enabled, OpenMP won't be used). I.e. each module using parallel_for_ (https://github.com/Itseez/opencv/search?q=parallel_for&type=Code) can possibly make use of OpenMP.

The modules listed by @tuannhtn are apart from parallel.cpp actually outdated and should be revised to use parallel_for_ instead (if anybody has some time and wants to help OpenCV, this would be a nice and easy task to contribute- also parallel_for should be converted to parallel_for_).

Note, you can also use parallel_for_ yourself and thus use it as a wrapper for TBB/OpenMP, too.

edit flag offensive delete link more

Comments

Learned it!

eatcosmos gravatar imageeatcosmos ( 2018-08-27 02:24:46 -0600 )edit
1

answered 2014-05-27 14:33:34 -0600

Witek gravatar image

OpenMP is NOT used in OpenCV anymore if I am not wrong. Instead, Intel TBB is used. For a list of parallelized functions scan the source code for phrase: HAVE_TBB.

edit flag offensive delete link more

Comments

For the TBB case, it is used, but not by default. But OpenMP, I'm not sure if it is not used, see this result (https://github.com/Itseez/opencv/search?l=cpp&q=OpenMP&ref=cmdform).

tuannhtn gravatar imagetuannhtn ( 2014-05-27 15:18:37 -0600 )edit

Here is a short guide on how to manually compile OpenCV with Intel's TBB library

Y Simson gravatar imageY Simson ( 2014-05-28 00:41:03 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2014-05-27 03:36:58 -0600

Seen: 6,882 times

Last updated: Aug 27 '18