Merge pull request #12877 from maver1:3.4
* Updated ICV packages and IPP integration * core(test): minMaxIdx IPP regression test * core(ipp): workaround minMaxIdx problem * core(ipp): workaround meanStdDev() CV_32FC3 buffer overrun * Returned semicolon after CV_INSTRUMENT_REGION_IPP()
This commit is contained in:
committed by
Alexander Alekhin
parent
c8fc8d210b
commit
e397434cb6
@@ -240,11 +240,12 @@ endif()
|
||||
|
||||
if(NOT DEFINED IPPROOT)
|
||||
include("${OpenCV_SOURCE_DIR}/3rdparty/ippicv/ippicv.cmake")
|
||||
download_ippicv(IPPROOT)
|
||||
if(NOT IPPROOT)
|
||||
download_ippicv(ICV_PACKAGE_ROOT)
|
||||
if(NOT ICV_PACKAGE_ROOT)
|
||||
return()
|
||||
endif()
|
||||
ocv_install_3rdparty_licenses(ippicv "${IPPROOT}/readme.htm" "${IPPROOT}/license/ippEULA.txt")
|
||||
set(IPPROOT "${ICV_PACKAGE_ROOT}/icv")
|
||||
ocv_install_3rdparty_licenses(ippicv "${IPPROOT}/readme.htm" "${ICV_PACKAGE_ROOT}/EULA.txt")
|
||||
endif()
|
||||
|
||||
file(TO_CMAKE_PATH "${IPPROOT}" __IPPROOT)
|
||||
|
||||
+61
-54
@@ -1,17 +1,19 @@
|
||||
#
|
||||
# The script to detect Intel(R) Integrated Performance Primitives Integration Wrappers (IPP IW)
|
||||
# The script to detect Intel(R) Integrated Performance Primitives Integration Wrappers (IPP Integration Wrappers)
|
||||
# installation/package
|
||||
#
|
||||
#
|
||||
# On return this will define:
|
||||
#
|
||||
# HAVE_IPP_IW - True if Intel IPP found
|
||||
# IPP_IW_PATH - Root of Intel IPP IW directory
|
||||
# IPP_IW_LIBRARIES - Intel IPP IW libraries
|
||||
# IPP_IW_INCLUDES - Intel IPP IW include folder
|
||||
# HAVE_IPP_IW - True if Intel IPP Integration Wrappers found
|
||||
# HAVE_IPP_IW_LL - True if Intel IPP Integration Wrappers found with Low Level API header
|
||||
# IPP_IW_PATH - Root of Intel IPP Integration Wrappers directory
|
||||
# IPP_IW_LIBRARIES - Intel IPP Integration Wrappers libraries
|
||||
# IPP_IW_INCLUDES - Intel IPP Integration Wrappers include folder
|
||||
#
|
||||
|
||||
unset(HAVE_IPP_IW CACHE)
|
||||
unset(HAVE_IPP_IW_LL CACHE)
|
||||
unset(IPP_IW_PATH)
|
||||
unset(IPP_IW_LIBRARIES)
|
||||
unset(IPP_IW_INCLUDES)
|
||||
@@ -29,13 +31,16 @@ macro(ippiw_debugmsg MESSAGE)
|
||||
endmacro()
|
||||
file(TO_CMAKE_PATH "${IPPROOT}" IPPROOT)
|
||||
|
||||
# This function detects Intel IPP IW version by analyzing .h file
|
||||
# This function detects Intel IPP Integration Wrappers version by analyzing .h file
|
||||
macro(ippiw_setup PATH BUILD)
|
||||
set(FILE "${PATH}/include/iw/iw_ll.h") # check if Intel IPP IW is OpenCV specific
|
||||
ippiw_debugmsg("Checking path: ${PATH}")
|
||||
set(FILE "${PATH}/include/iw/iw_version.h")
|
||||
if(${BUILD})
|
||||
ippiw_debugmsg("Checking sources: ${PATH}")
|
||||
else()
|
||||
ippiw_debugmsg("Checking binaries: ${PATH}")
|
||||
endif()
|
||||
if(EXISTS "${FILE}")
|
||||
set(FILE "${PATH}/include/iw/iw_version.h")
|
||||
ippiw_debugmsg("vfile\tok")
|
||||
ippiw_debugmsg("vfile\tfound")
|
||||
file(STRINGS "${FILE}" IW_VERSION_MAJOR REGEX "IW_VERSION_MAJOR")
|
||||
file(STRINGS "${FILE}" IW_VERSION_MINOR REGEX "IW_VERSION_MINOR")
|
||||
file(STRINGS "${FILE}" IW_VERSION_UPDATE REGEX "IW_VERSION_UPDATE")
|
||||
@@ -56,13 +61,13 @@ macro(ippiw_setup PATH BUILD)
|
||||
math(EXPR IW_MIN_COMPATIBLE_IPP_EXP "${IW_MIN_COMPATIBLE_IPP_MAJOR}*10000 + ${IW_MIN_COMPATIBLE_IPP_MINOR}*100 + ${IW_MIN_COMPATIBLE_IPP_UPDATE}")
|
||||
|
||||
if((IPP_VERSION_EXP GREATER IW_MIN_COMPATIBLE_IPP_EXP) OR (IPP_VERSION_EXP EQUAL IW_MIN_COMPATIBLE_IPP_EXP))
|
||||
ippiw_debugmsg("version\tok")
|
||||
ippiw_debugmsg("vcheck\tpassed")
|
||||
if(${BUILD})
|
||||
# check sources
|
||||
if(EXISTS "${PATH}/src/iw_core.c")
|
||||
ippiw_debugmsg("sources\tok")
|
||||
ippiw_debugmsg("sources\tyes")
|
||||
set(IPP_IW_PATH "${PATH}")
|
||||
message(STATUS "found Intel IPP IW sources: ${IW_VERSION_MAJOR}.${IW_VERSION_MINOR}.${IW_VERSION_UPDATE}")
|
||||
message(STATUS "found Intel IPP Integration Wrappers sources: ${IW_VERSION_MAJOR}.${IW_VERSION_MINOR}.${IW_VERSION_UPDATE}")
|
||||
message(STATUS "at: ${IPP_IW_PATH}")
|
||||
|
||||
set(IPP_IW_LIBRARY ippiw)
|
||||
@@ -72,7 +77,13 @@ macro(ippiw_setup PATH BUILD)
|
||||
add_subdirectory("${IPP_IW_PATH}/" ${OpenCV_BINARY_DIR}/3rdparty/ippiw)
|
||||
|
||||
set(HAVE_IPP_IW 1)
|
||||
set(FILE "${PATH}/include/iw/iw_ll.h") # check if Intel IPP Integration Wrappers is OpenCV specific
|
||||
if(EXISTS "${FILE}")
|
||||
set(HAVE_IPP_IW_LL 1)
|
||||
endif()
|
||||
return()
|
||||
else()
|
||||
ippiw_debugmsg("sources\tno")
|
||||
endif()
|
||||
else()
|
||||
# check binaries
|
||||
@@ -82,9 +93,9 @@ macro(ippiw_setup PATH BUILD)
|
||||
set(FILE "${PATH}/lib/ia32/${CMAKE_STATIC_LIBRARY_PREFIX}ipp_iw${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
if(EXISTS ${FILE})
|
||||
ippiw_debugmsg("binaries\tok (64=${IPP_X64})")
|
||||
ippiw_debugmsg("binaries\tyes (64=${IPP_X64})")
|
||||
set(IPP_IW_PATH "${PATH}")
|
||||
message(STATUS "found Intel IPP IW binaries: ${IW_VERSION_MAJOR}.${IW_VERSION_MINOR}.${IW_VERSION_UPDATE}")
|
||||
message(STATUS "found Intel IPP Integration Wrappers binaries: ${IW_VERSION_MAJOR}.${IW_VERSION_MINOR}.${IW_VERSION_UPDATE}")
|
||||
message(STATUS "at: ${IPP_IW_PATH}")
|
||||
|
||||
add_library(ippiw STATIC IMPORTED)
|
||||
@@ -105,81 +116,77 @@ macro(ippiw_setup PATH BUILD)
|
||||
|
||||
set(HAVE_IPP_IW 1)
|
||||
set(BUILD_IPP_IW 0)
|
||||
set(FILE "${PATH}/include/iw/iw_ll.h") # check if Intel IPP Integration Wrappers is OpenCV specific
|
||||
if(EXISTS "${FILE}")
|
||||
set(HAVE_IPP_IW_LL 1)
|
||||
endif()
|
||||
return()
|
||||
else()
|
||||
ippiw_debugmsg("binaries\tno")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
ippiw_debugmsg("vcheck\tfailed")
|
||||
endif()
|
||||
else()
|
||||
ippiw_debugmsg("vfile\tnot found")
|
||||
endif()
|
||||
set(HAVE_IPP_IW 0)
|
||||
set(HAVE_IPP_IW_LL 0)
|
||||
endmacro()
|
||||
|
||||
# check os and architecture
|
||||
if(APPLE)
|
||||
set(IW_PACKAGE_SUBDIR "ippiw_mac")
|
||||
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
|
||||
set(IW_PACKAGE_SUBDIR "ippiw_lnx")
|
||||
elseif(WIN32 AND NOT ARM)
|
||||
set(IW_PACKAGE_SUBDIR "ippiw_win")
|
||||
else()
|
||||
message(SEND_ERROR "Improper system for Intel IPP Integrations Wrappers. This message shouldn't appear. Check Intel IPP configurations steps")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# check build options first
|
||||
if(BUILD_IPP_IW)
|
||||
# custom path
|
||||
if(DEFINED IPPIWROOT)
|
||||
ippiw_setup("${IPPIWROOT}/" 1)
|
||||
message(STATUS "Can't find Intel IPP IW sources at: ${IPPIWROOT}")
|
||||
message(STATUS "Can't find Intel IPP Integration Wrappers sources at: ${IPPIWROOT}")
|
||||
endif()
|
||||
|
||||
# local sources
|
||||
ippiw_setup("${OpenCV_SOURCE_DIR}/3rdparty/ippiw" 1)
|
||||
|
||||
set(IPPIW_ROOT "${IPPROOT}/../${IW_PACKAGE_SUBDIR}")
|
||||
set(IPPIW_ROOT "${IPPROOT}/../iw")
|
||||
ocv_install_3rdparty_licenses(ippiw
|
||||
"${IPPIW_ROOT}/EULA.txt"
|
||||
"${IPPIW_ROOT}/redist.txt"
|
||||
"${IPPIW_ROOT}/support.txt"
|
||||
"${IPPIW_ROOT}/third-party-programs.txt")
|
||||
"${IPPIW_ROOT}/../EULA.txt"
|
||||
"${IPPIW_ROOT}/../support.txt"
|
||||
"${IPPIW_ROOT}/../third-party-programs.txt")
|
||||
|
||||
# Package sources
|
||||
get_filename_component(__PATH "${IPPROOT}/../${IW_PACKAGE_SUBDIR}/" ABSOLUTE)
|
||||
get_filename_component(__PATH "${IPPROOT}/../iw/" ABSOLUTE)
|
||||
ippiw_setup("${__PATH}" 1)
|
||||
|
||||
# take Intel IPP Integration Wrappers from ICV package
|
||||
if(NOT HAVE_IPP_ICV)
|
||||
message(STATUS "Cannot find Intel IPP Integration Wrappers. Checking \"Intel IPP for OpenCV\" package")
|
||||
set(TEMP_ROOT 0)
|
||||
include("${OpenCV_SOURCE_DIR}/3rdparty/ippicv/ippicv.cmake")
|
||||
download_ippicv(TEMP_ROOT)
|
||||
set(IPPIW_ROOT "${TEMP_ROOT}/iw/")
|
||||
ocv_install_3rdparty_licenses(ippiw
|
||||
"${IPPIW_ROOT}/../EULA.txt"
|
||||
"${IPPIW_ROOT}/../support.txt"
|
||||
"${IPPIW_ROOT}/../third-party-programs.txt")
|
||||
|
||||
ippiw_setup("${IPPIW_ROOT}" 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# custom binaries
|
||||
if(DEFINED IPPIWROOT)
|
||||
ippiw_setup("${IPPIWROOT}/" 0)
|
||||
message(STATUS "Can't find Intel IPP IW sources at: ${IPPIWROOT}")
|
||||
message(STATUS "Can't find Intel IPP Integration Wrappers binaries at: ${IPPIWROOT}")
|
||||
endif()
|
||||
|
||||
# check binaries in IPP folder
|
||||
ippiw_setup("${IPPROOT}/" 0)
|
||||
|
||||
# check binaries near IPP folder
|
||||
ippiw_setup("${IPPROOT}/../${IW_PACKAGE_SUBDIR}/" 0)
|
||||
|
||||
|
||||
# take Intel IPP IW from ICV package
|
||||
if(NOT HAVE_IPP_ICV AND BUILD_IPP_IW)
|
||||
message(STATUS "Cannot find Intel IPP IW. Checking \"Intel IPP for OpenCV\" package")
|
||||
set(TEMP_ROOT 0)
|
||||
include("${OpenCV_SOURCE_DIR}/3rdparty/ippicv/ippicv.cmake")
|
||||
download_ippicv(TEMP_ROOT)
|
||||
set(IPPIW_ROOT "${TEMP_ROOT}/../${IW_PACKAGE_SUBDIR}")
|
||||
ocv_install_3rdparty_licenses(ippiw
|
||||
"${IPPIW_ROOT}/EULA.txt"
|
||||
"${IPPIW_ROOT}/redist.txt"
|
||||
"${IPPIW_ROOT}/support.txt"
|
||||
"${IPPIW_ROOT}/third-party-programs.txt")
|
||||
|
||||
# Package sources. Only sources are compatible with regular Intel IPP
|
||||
ippiw_setup("${IPPIW_ROOT}" 1)
|
||||
endif()
|
||||
ippiw_setup("${IPPROOT}/../iw/" 0)
|
||||
|
||||
|
||||
set(HAVE_IPP_IW 0)
|
||||
set(HAVE_IPP_IW_LL 0)
|
||||
message(STATUS "Cannot find Intel IPP Integration Wrappers, optimizations will be limited. Use IPPIWROOT to set custom location")
|
||||
return()
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
#cmakedefine HAVE_IPP
|
||||
#cmakedefine HAVE_IPP_ICV
|
||||
#cmakedefine HAVE_IPP_IW
|
||||
#cmakedefine HAVE_IPP_IW_LL
|
||||
|
||||
/* JPEG-2000 codec */
|
||||
#cmakedefine HAVE_JASPER
|
||||
|
||||
Reference in New Issue
Block a user