Detect and report parallel framework used

pull/483/head
Andrey Kamaev 12 years ago
parent 0b20faf3d2
commit c7df17e77b
  1. 13
      CMakeLists.txt
  2. 37
      cmake/OpenCVFindLibsPerf.cmake

@ -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("")

@ -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()

Loading…
Cancel
Save