Hello there. I have compiled OpenCV 3.4.16 with “WITH_TBB” and “WITH_OPENMP” flags enabled by using CMake 3.22.0. The TBB version I used was tbb2019_20191006. Then I built libraries for Release and Debug by using Visual Studio 2019 Community Edition. When I check
build information using cv::getBuildInformation( ) I don’t see any information about TBB, it only says OpenMP.
cv::getBuildInformation( ) results
Do I need to make separate builds for OpenMP and Intel TBB? If I don’t need to build them as separate builds, how do I activate/select to use OpenMP or Intel TBB in my OpenCV code?
thanks for reply, opencv did choose the parallel framework by the following order:
/* IMPORTANT: always use the same order of defines
1. HAVE_TBB - 3rdparty library, should be explicitly enabled
2. HAVE_CSTRIPES - 3rdparty library, should be explicitly enabled
3. HAVE_OPENMP - integrated to compiler, should be explicitly enabled
4. HAVE_GCD - system wide, used automatically (APPLE only)
5. HAVE_CONCURRENCY - part of runtime, used automatically (Windows only - MSVS 10, MSVS 11)
*/
and i also find that we can explicit select by this api setParallelForBackend .
BTW, do you know which parallel framework is faster on windows with cpu?
thanks, i try to build opencv with tbb, i set -DWITH_TBB=ON, i also download TBB, how ca i tell opencv where to find tbb?is there some other cmake option to set?
/* IMPORTANT: always use the same order of defines
1. HAVE_TBB - 3rdparty library, should be explicitly enabled
2. HAVE_CSTRIPES - 3rdparty library, should be explicitly enabled
3. HAVE_OPENMP - integrated to compiler, should be explicitly enabled
4. HAVE_GCD - system wide, used automatically (APPLE only)
5. HAVE_CONCURRENCY - part of runtime, used automatically (Windows only - MSVS 10, MSVS 11)
*/