From: Andrey Kamaev Date: Wed, 13 Feb 2013 11:09:30 +0000 (+0400) Subject: Detect and report parallel framework used X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~1514^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7df17e77bd88f35c62f7846dbbb1747ec763f9b;p=platform%2Fupstream%2Fopencv.git Detect and report parallel framework used --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f1c328..074d972 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -770,11 +770,14 @@ else() status(" Use IPP:" WITH_IPP AND NOT IPP_FOUND THEN "IPP not found" ELSE NO) endif() -status(" Use TBB:" HAVE_TBB THEN "YES (ver ${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR} interface ${TBB_INTERFACE_VERSION})" ELSE NO) -status(" Use C=:" HAVE_CSTRIPES THEN YES ELSE NO) -status(" Use Cuda:" HAVE_CUDA THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO) -status(" Use OpenCL:" HAVE_OPENCL THEN YES ELSE NO) -status(" Use Eigen:" HAVE_EIGEN THEN "YES (ver ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})" ELSE NO) +status(" Use Eigen:" HAVE_EIGEN THEN "YES (ver ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})" ELSE NO) +status(" Use TBB:" HAVE_TBB THEN "YES (ver ${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR} interface ${TBB_INTERFACE_VERSION})" ELSE NO) +status(" Use OpenMP:" HAVE_OPENMP THEN YES ELSE NO) +status(" Use GCD" HAVE_GCD THEN YES ELSE NO) +status(" Use Concurrency" HAVE_CONCURRENCY THEN YES ELSE NO) +status(" Use C=:" HAVE_CSTRIPES THEN YES ELSE NO) +status(" Use Cuda:" HAVE_CUDA THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO) +status(" Use OpenCL:" HAVE_OPENCL THEN YES ELSE NO) if(HAVE_CUDA) status("") diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake index 86815c0..b94c357 100644 --- a/cmake/OpenCVFindLibsPerf.cmake +++ b/cmake/OpenCVFindLibsPerf.cmake @@ -7,11 +7,6 @@ if(WITH_TBB) include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectTBB.cmake") endif(WITH_TBB) -# --- C= --- -if(WITH_CSTRIPES) - include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCStripes.cmake") -endif(WITH_CSTRIPES) - # --- IPP --- ocv_clear_vars(IPP_FOUND) if(WITH_IPP) @@ -43,3 +38,35 @@ if(WITH_EIGEN) set(HAVE_EIGEN 1) endif() endif(WITH_EIGEN) + +# --- C= --- +if(WITH_CSTRIPES AND NOT HAVE_TBB) + include("${OpenCV_SOURCE_DIR}/cmake/OpenCVDetectCStripes.cmake") +else() + set(HAVE_CSTRIPES 0) +endif() + +# --- OpenMP --- +if(NOT HAVE_TBB AND NOT HAVE_CSTRIPES) + set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/omptest.cpp") + FILE(WRITE "${_fname}" "#ifndef _OPENMP\n#error\n#endif\nint main() { return 0; }\n") + TRY_COMPILE(HAVE_OPENMP "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp" "${_fname}") +else() + set(HAVE_OPENMP 0) +endif() + +# --- GCD --- +if(APPLE AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP) + set(HAVE_GCD 1) +else() + set(HAVE_GCD 0) +endif() + +# --- Concurrency --- +if(MSVC AND NOT HAVE_TBB AND NOT HAVE_CSTRIPES AND NOT HAVE_OPENMP) + set(_fname "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/concurrencytest.cpp") + FILE(WRITE "${_fname}" "#if _MSC_VER < 1600\n#error\n#endif\nint main() { return 0; }\n") + TRY_COMPILE(HAVE_CONCURRENCY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp" "${_fname}") +else() + set(HAVE_CONCURRENCY 0) +endif()