Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
695c5183
Commit
695c5183
authored
Nov 23, 2016
by
mshabunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated TBB search script and code checks
parent
46a333ed
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
128 additions
and
192 deletions
+128
-192
CMakeLists.txt
3rdparty/tbb/CMakeLists.txt
+6
-24
boost.cpp
apps/traincascade/boost.cpp
+5
-9
OpenCVDetectTBB.cmake
cmake/OpenCVDetectTBB.cmake
+74
-83
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+3
-3
private.hpp
modules/core/include/opencv2/core/private.hpp
+4
-9
parallel.cpp
modules/core/src/parallel.cpp
+24
-29
cap_openni.cpp
modules/videoio/src/cap_openni.cpp
+0
-4
cap_openni2.cpp
modules/videoio/src/cap_openni2.cpp
+0
-4
driver_api_multi.cpp
samples/gpu/driver_api_multi.cpp
+4
-9
driver_api_stereo_multi.cpp
samples/gpu/driver_api_stereo_multi.cpp
+4
-9
multi.cpp
samples/gpu/multi.cpp
+4
-9
No files found.
3rdparty/tbb/CMakeLists.txt
View file @
695c5183
...
@@ -70,20 +70,6 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
...
@@ -70,20 +70,6 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
#set(tbb_md5 "4669e7d4adee018de7a7b8b972987218")
#set(tbb_md5 "4669e7d4adee018de7a7b8b972987218")
#set(tbb_version_file "version_string.tmp")
#set(tbb_version_file "version_string.tmp")
# 4.0 update 2 - works fine
#set(tbb_ver "tbb40_20111130oss")
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb40_20111130oss_src.tgz")
#set(tbb_md5 "1e6926b21e865e79772119cd44fc3ad8")
#set(tbb_version_file "version_string.tmp")
#set(tbb_need_GENERIC_DWORD_LOAD_STORE TRUE)
# 4.0 update 1 - works fine
#set(tbb_ver "tbb40_20111003oss")
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb40_20111003oss_src.tgz")
#set(tbb_md5 "7b5d94eb35a563b29ef402e0fd8f15c9")
#set(tbb_version_file "version_string.tmp")
#set(tbb_need_GENERIC_DWORD_LOAD_STORE TRUE)
set
(
tbb_tarball
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
tbb_ver
}
_src.tgz"
)
set
(
tbb_tarball
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
tbb_ver
}
_src.tgz"
)
set
(
tbb_src_dir
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
tbb_ver
}
"
)
set
(
tbb_src_dir
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
tbb_ver
}
"
)
...
@@ -127,8 +113,6 @@ if(NOT EXISTS "${tbb_src_dir}")
...
@@ -127,8 +113,6 @@ if(NOT EXISTS "${tbb_src_dir}")
endif
()
endif
()
endif
()
endif
()
set
(
TBB_INCLUDE_DIRS
"
${
tbb_src_dir
}
/include"
PARENT_SCOPE
)
ocv_include_directories
(
"
${
tbb_src_dir
}
/include"
ocv_include_directories
(
"
${
tbb_src_dir
}
/include"
"
${
tbb_src_dir
}
/src/"
"
${
tbb_src_dir
}
/src/"
"
${
tbb_src_dir
}
/src/rml/include"
"
${
tbb_src_dir
}
/src/rml/include"
...
@@ -173,6 +157,9 @@ endif()
...
@@ -173,6 +157,9 @@ endif()
if
(
CMAKE_COMPILER_IS_GNUCXX
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
add_definitions
(
-DTBB_USE_GCC_BUILTINS=1
)
#required for ARM GCC
add_definitions
(
-DTBB_USE_GCC_BUILTINS=1
)
#required for ARM GCC
if
(
NOT CMAKE_OPENCV_GCC_VERSION_NUM LESS 600
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-flifetime-dse=1"
)
# workaround for GCC 6.x
endif
()
endif
()
endif
()
if
(
ANDROID_COMPILER_IS_CLANG
)
if
(
ANDROID_COMPILER_IS_CLANG
)
...
@@ -180,12 +167,6 @@ if(ANDROID_COMPILER_IS_CLANG)
...
@@ -180,12 +167,6 @@ if(ANDROID_COMPILER_IS_CLANG)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wmissing-prototypes
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wmissing-prototypes
)
endif
()
endif
()
if
(
tbb_need_GENERIC_DWORD_LOAD_STORE
)
#needed by TBB 4.0 update 1,2; fixed in TBB 4.0 update 3 but it has 2 new problems
add_definitions
(
-D__TBB_USE_GENERIC_DWORD_LOAD_STORE=1
)
set
(
tbb_need_GENERIC_DWORD_LOAD_STORE ON PARENT_SCOPE
)
endif
()
set
(
TBB_SOURCE_FILES
${
lib_srcs
}
${
lib_hdrs
}
)
set
(
TBB_SOURCE_FILES
${
lib_srcs
}
${
lib_hdrs
}
)
if
(
ARM AND NOT WIN32
)
if
(
ARM AND NOT WIN32
)
...
@@ -199,6 +180,8 @@ endif()
...
@@ -199,6 +180,8 @@ endif()
set
(
TBB_SOURCE_FILES
${
TBB_SOURCE_FILES
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
tbb_version_file
}
"
)
set
(
TBB_SOURCE_FILES
${
TBB_SOURCE_FILES
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
tbb_version_file
}
"
)
add_library
(
tbb
${
TBB_SOURCE_FILES
}
)
add_library
(
tbb
${
TBB_SOURCE_FILES
}
)
target_compile_definitions
(
tbb PRIVATE TBB_USE_GCC_BUILTINS=1 __TBB_GCC_BUILTIN_ATOMICS_PRESENT=1
)
target_include_directories
(
tbb SYSTEM PUBLIC $<BUILD_INTERFACE:
${
tbb_src_dir
}
/include>
)
if
(
WIN32
)
if
(
WIN32
)
if
(
ARM
)
if
(
ARM
)
...
@@ -251,5 +234,4 @@ ocv_install_target(tbb EXPORT OpenCVModules
...
@@ -251,5 +234,4 @@ ocv_install_target(tbb EXPORT OpenCVModules
ARCHIVE DESTINATION
${
OPENCV_3P_LIB_INSTALL_PATH
}
COMPONENT dev
ARCHIVE DESTINATION
${
OPENCV_3P_LIB_INSTALL_PATH
}
COMPONENT dev
)
)
# get TBB version
ocv_tbb_read_version
(
"
${
tbb_src_dir
}
/include"
)
ocv_parse_header
(
"
${
tbb_src_dir
}
/include/tbb/tbb_stddef.h"
TBB_VERSION_LINES TBB_VERSION_MAJOR TBB_VERSION_MINOR TBB_INTERFACE_VERSION CACHE
)
apps/traincascade/boost.cpp
View file @
695c5183
...
@@ -33,16 +33,12 @@ using cv::ParallelLoopBody;
...
@@ -33,16 +33,12 @@ using cv::ParallelLoopBody;
#include "cxmisc.h"
#include "cxmisc.h"
#include "cvconfig.h"
#include "cvconfig.h"
#ifdef HAVE_TBB
#ifdef HAVE_TBB
# include "tbb/tbb_stddef.h"
# include "tbb/tbb.h"
# if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
# include "tbb/task.h"
# include "tbb/tbb.h"
# undef min
# include "tbb/task.h"
# undef max
# undef min
# undef max
# else
# undef HAVE_TBB
# endif
#endif
#endif
#ifdef HAVE_TBB
#ifdef HAVE_TBB
...
...
cmake/OpenCVDetectTBB.cmake
View file @
695c5183
if
(
BUILD_TBB
)
# Search TBB library (4.1 - 4.4, 2017)
add_subdirectory
(
"
${
OpenCV_SOURCE_DIR
}
/3rdparty/tbb"
)
#
include_directories
(
SYSTEM
${
TBB_INCLUDE_DIRS
}
)
# Own TBB (3rdparty/tbb):
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
tbb
)
# - set cmake option BUILD_TBB to ON
add_definitions
(
-DTBB_USE_GCC_BUILTINS=1 -D__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1
)
#
if
(
tbb_need_GENERIC_DWORD_LOAD_STORE
)
# External TBB (from system):
add_definitions
(
-D__TBB_USE_GENERIC_DWORD_LOAD_STORE=1
)
# - Fedora: install 'tbb-devel' package
endif
()
# - Ubuntu: install 'libtbb-dev' package
set
(
HAVE_TBB 1
)
#
elseif
(
UNIX AND NOT APPLE
)
# External TBB (from official site):
PKG_CHECK_MODULES
(
TBB tbb
)
# - Linux/OSX:
# - in tbbvars.sh replace 'SUBSTITUTE_INSTALL_DIR_HERE' with absolute path to TBB dir
# - in terminal run 'source tbbvars.sh intel64 linux' ('source tbbvars.sh' in OSX)
# - Windows:
# - in terminal run 'tbbvars.bat intel64 vs2015'
#
# Return:
# - HAVE_TBB set to TRUE
# - "tbb" target exists and added to OPENCV_LINKER_LIBS
if
(
TBB_FOUND
)
function
(
ocv_tbb_verify
)
set
(
HAVE_TBB 1
)
if
(
NOT
"$ENV{TBBROOT}"
STREQUAL
""
)
if
(
NOT
${
TBB_INCLUDE_DIRS
}
STREQUAL
""
)
# check that library and include dir are inside TBBROOT location
ocv_include_directories
(
${
TBB_INCLUDE_DIRS
}
)
get_filename_component
(
_root
"$ENV{TBBROOT}"
ABSOLUTE
)
get_filename_component
(
_lib
"
${
TBB_ENV_LIB
}
"
ABSOLUTE
)
get_filename_component
(
_inc
"
${
TBB_ENV_INCLUDE
}
"
ABSOLUTE
)
string
(
FIND
"
${
_lib
}
"
"
${
_root
}
"
_lib_pos
)
string
(
FIND
"
${
_inc
}
"
"
${
_root
}
"
_inc_pos
)
if
(
NOT
(
_lib_pos EQUAL 0 AND _inc_pos EQUAL 0
))
message
(
SEND_ERROR
"Possible issue with TBB detection - TBBROOT is set, "
"but library/include path is not inside it:
\n
"
"TBBROOT: $ENV{TBBROOT}
\n
"
"(absolute):
${
_root
}
\n
"
"INCLUDE:
${
_inc
}
\n
"
"LIBRARY:
${
_lib
}
\n
"
)
endif
()
endif
()
link_directories
(
${
TBB_LIBRARY_DIRS
}
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
${
TBB_LIBRARIES
}
)
endif
()
endif
()
end
if
()
end
function
()
if
(
NOT HAVE_TBB
)
function
(
ocv_tbb_env_guess _found
)
set
(
TBB_DEFAULT_INCLUDE_DIRS
find_path
(
TBB_ENV_INCLUDE NAMES
"tbb/tbb.h"
PATHS ENV CPATH NO_DEFAULT_PATH
)
"/opt/intel/tbb/include"
"/usr/local/include"
"/usr/include"
find_path
(
TBB_ENV_INCLUDE NAMES
"tbb/tbb.h"
)
"C:/Program Files/Intel/TBB"
"C:/Program Files (x86)/Intel/TBB"
find_library
(
TBB_ENV_LIB NAMES
"tbb"
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH
)
"C:/Program Files/tbb/include"
find_library
(
TBB_ENV_LIB NAMES
"tbb"
)
"C:/Program Files (x86)/tbb/include"
find_library
(
TBB_ENV_LIB_DEBUG NAMES
"tbb_debug"
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH
)
"
${
CMAKE_INSTALL_PREFIX
}
/include"
)
find_library
(
TBB_ENV_LIB_DEBUG NAMES
"tbb_debug"
)
if
(
TBB_ENV_INCLUDE AND TBB_ENV_LIB
)
ocv_tbb_verify
()
ocv_tbb_read_version
(
"
${
TBB_ENV_INCLUDE
}
"
)
add_library
(
tbb UNKNOWN IMPORTED
)
set_target_properties
(
tbb PROPERTIES
IMPORTED_LOCATION
"
${
TBB_ENV_LIB
}
"
IMPORTED_LOCATION_DEBUG
"
${
TBB_ENV_LIB_DEBUG
}
"
INTERFACE_INCLUDE_DIRECTORIES
"
${
TBB_ENV_INCLUDE
}
"
)
message
(
STATUS
"Found TBB:
${
TBB_ENV_LIB
}
"
)
set
(
${
_found
}
TRUE PARENT_SCOPE
)
endif
()
endfunction
()
find_path
(
TBB_INCLUDE_DIRS
"tbb/tbb.h"
PATHS
${
TBB_INCLUDE_DIR
}
${
TBB_DEFAULT_INCLUDE_DIRS
}
DOC
"The path to TBB headers"
)
function
(
ocv_tbb_read_version _path
)
if
(
TBB_INCLUDE_DIRS
)
find_file
(
TBB_VER_FILE tbb/tbb_stddef.h
"
${
_path
}
"
NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH
)
if
(
UNIX
)
ocv_parse_header
(
"
${
TBB_VER_FILE
}
"
TBB_VERSION_LINES TBB_VERSION_MAJOR TBB_VERSION_MINOR TBB_INTERFACE_VERSION CACHE
)
set
(
TBB_LIB_DIR
"
${
TBB_INCLUDE_DIRS
}
/../lib"
CACHE PATH
"Full path of TBB library directory"
)
endfunction
()
link_directories
(
"
${
TBB_LIB_DIR
}
"
)
endif
()
if
(
APPLE
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
libtbb.dylib
)
elseif
(
ANDROID
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
tbb
)
add_definitions
(
-DTBB_USE_GCC_BUILTINS
)
elseif
(
UNIX
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
tbb
)
elseif
(
WIN32
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
set
(
TBB_LIB_DIR
"
${
TBB_INCLUDE_DIRS
}
/../lib"
CACHE PATH
"Full path of TBB library directory"
)
link_directories
(
"
${
TBB_LIB_DIR
}
"
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
tbb
)
else
()
get_filename_component
(
_TBB_LIB_PATH
"
${
TBB_INCLUDE_DIRS
}
/../lib"
ABSOLUTE
)
if
(
CMAKE_SYSTEM_PROCESSOR MATCHES amd64*|x86_64* OR MSVC64
)
#=====================================================================
set
(
_TBB_LIB_PATH
"
${
_TBB_LIB_PATH
}
/intel64"
)
else
()
set
(
_TBB_LIB_PATH
"
${
_TBB_LIB_PATH
}
/ia32"
)
endif
()
if
(
MSVC80
)
if
(
BUILD_TBB
)
set
(
_TBB_LIB_PATH
"
${
_TBB_LIB_PATH
}
/vc8"
)
add_subdirectory
(
"
${
OpenCV_SOURCE_DIR
}
/3rdparty/tbb"
)
elseif
(
MSVC90
)
message
(
STATUS
"Found TBB: build"
)
set
(
_TBB_LIB_PATH
"
${
_TBB_LIB_PATH
}
/vc9"
)
set
(
HAVE_TBB TRUE
)
elseif
(
MSVC10
)
endif
()
set
(
_TBB_LIB_PATH
"
${
_TBB_LIB_PATH
}
/vc10"
)
elseif
(
MSVC11
)
set
(
_TBB_LIB_PATH
"
${
_TBB_LIB_PATH
}
/vc11"
)
elseif
(
MSVC12
)
set
(
_TBB_LIB_PATH
"
${
_TBB_LIB_PATH
}
/vc12"
)
elseif
(
MSVC14
)
set
(
_TBB_LIB_PATH
"
${
_TBB_LIB_PATH
}
/vc14"
)
endif
()
set
(
TBB_LIB_DIR
"
${
_TBB_LIB_PATH
}
"
CACHE PATH
"Full path of TBB library directory"
)
link_directories
(
"
${
TBB_LIB_DIR
}
"
)
endif
()
endif
()
set
(
HAVE_TBB 1
)
if
(
NOT HAVE_TBB
)
if
(
NOT
"
${
TBB_INCLUDE_DIRS
}
"
STREQUAL
""
)
ocv_tbb_env_guess
(
HAVE_TBB
)
ocv_include_directories
(
"
${
TBB_INCLUDE_DIRS
}
"
)
endif
()
endif
()
endif
(
TBB_INCLUDE_DIRS
)
endif
(
NOT HAVE_TBB
)
# get TBB version
if
(
TBB_INTERFACE_VERSION LESS 6000
)
# drop support of versions < 4.0
if
(
HAVE_TBB
)
set
(
HAVE_TBB FALSE
)
find_file
(
TBB_STDDEF_PATH tbb/tbb_stddef.h
"
${
TBB_INCLUDE_DIRS
}
"
)
mark_as_advanced
(
TBB _STDDEF_PATH
)
endif
()
endif
()
if
(
HAVE_TBB AND TBB_STDDEF_PATH
)
ocv_parse_header
(
"
${
TBB_STDDEF_PATH
}
"
TBB_VERSION_LINES TBB_VERSION_MAJOR TBB_VERSION_MINOR TBB_INTERFACE_VERSION
)
if
(
HAVE_TBB
)
else
()
list
(
APPEND OPENCV_LINKER_LIBS tbb
)
unset
(
TBB_VERSION_MAJOR
)
unset
(
TBB_VERSION_MINOR
)
unset
(
TBB_INTERFACE_VERSION
)
endif
()
endif
()
cmake/OpenCVUtils.cmake
View file @
695c5183
...
@@ -687,9 +687,9 @@ macro(ocv_parse_header FILENAME FILE_VAR)
...
@@ -687,9 +687,9 @@ macro(ocv_parse_header FILENAME FILE_VAR)
set
(
__parnet_scope OFF
)
set
(
__parnet_scope OFF
)
set
(
__add_cache OFF
)
set
(
__add_cache OFF
)
foreach
(
name
${
ARGN
}
)
foreach
(
name
${
ARGN
}
)
if
(
"
${
name
}
"
STREQUAL
"PARENT_SCOPE"
)
if
(
${
name
}
STREQUAL
"PARENT_SCOPE"
)
set
(
__parnet_scope ON
)
set
(
__parnet_scope ON
)
elseif
(
"
${
name
}
"
STREQUAL
"CACHE"
)
elseif
(
${
name
}
STREQUAL
"CACHE"
)
set
(
__add_cache ON
)
set
(
__add_cache ON
)
elseif
(
vars_regex
)
elseif
(
vars_regex
)
set
(
vars_regex
"
${
vars_regex
}
|
${
name
}
"
)
set
(
vars_regex
"
${
vars_regex
}
|
${
name
}
"
)
...
@@ -703,7 +703,7 @@ macro(ocv_parse_header FILENAME FILE_VAR)
...
@@ -703,7 +703,7 @@ macro(ocv_parse_header FILENAME FILE_VAR)
unset
(
${
FILE_VAR
}
)
unset
(
${
FILE_VAR
}
)
endif
()
endif
()
foreach
(
name
${
ARGN
}
)
foreach
(
name
${
ARGN
}
)
if
(
NOT
"
${
name
}
"
STREQUAL
"PARENT_SCOPE"
AND NOT
"
${
name
}
"
STREQUAL
"CACHE"
)
if
(
NOT
${
name
}
STREQUAL
"PARENT_SCOPE"
AND NOT
${
name
}
STREQUAL
"CACHE"
)
if
(
${
FILE_VAR
}
)
if
(
${
FILE_VAR
}
)
if
(
${
FILE_VAR
}
MATCHES
".+[
\t
]
${
name
}
[
\t
]+([0-9]+).*"
)
if
(
${
FILE_VAR
}
MATCHES
".+[
\t
]
${
name
}
[
\t
]+([0-9]+).*"
)
string
(
REGEX REPLACE
".+[
\t
]
${
name
}
[
\t
]+([0-9]+).*"
"
\\
1"
${
name
}
"
${${
FILE_VAR
}}
"
)
string
(
REGEX REPLACE
".+[
\t
]
${
name
}
[
\t
]+([0-9]+).*"
"
\\
1"
${
name
}
"
${${
FILE_VAR
}}
"
)
...
...
modules/core/include/opencv2/core/private.hpp
View file @
695c5183
...
@@ -60,15 +60,10 @@
...
@@ -60,15 +60,10 @@
#endif
#endif
#ifdef HAVE_TBB
#ifdef HAVE_TBB
# include "tbb/tbb_stddef.h"
# include "tbb/tbb.h"
# if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
# include "tbb/task.h"
# include "tbb/tbb.h"
# undef min
# include "tbb/task.h"
# undef max
# undef min
# undef max
# else
# undef HAVE_TBB
# endif
#endif
#endif
#if defined HAVE_FP16 && (defined __F16C__ || (defined _MSC_VER && _MSC_VER >= 1700))
#if defined HAVE_FP16 && (defined __F16C__ || (defined _MSC_VER && _MSC_VER >= 1700))
...
...
modules/core/src/parallel.cpp
View file @
695c5183
...
@@ -84,37 +84,30 @@
...
@@ -84,37 +84,30 @@
*/
*/
#if defined HAVE_TBB
#if defined HAVE_TBB
#include "tbb/tbb.h"
#include "tbb/task.h"
#include "tbb/tbb_stddef.h"
#include "tbb/tbb_stddef.h"
#if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
#if TBB_INTERFACE_VERSION >= 8000
#include "tbb/tbb.h"
#include "tbb/task_arena.h"
#include "tbb/task.h"
#if TBB_INTERFACE_VERSION >= 6100
#include "tbb/task_arena.h"
#endif
#undef min
#undef max
#else
#undef HAVE_TBB
#endif // end TBB version
#endif
#ifndef HAVE_TBB
#if defined HAVE_CSTRIPES
#include "C=.h"
#undef shared
#elif defined HAVE_OPENMP
#include <omp.h>
#elif defined HAVE_GCD
#include <dispatch/dispatch.h>
#include <pthread.h>
#elif defined WINRT && _MSC_VER < 1900
#include <ppltasks.h>
#elif defined HAVE_CONCURRENCY
#include <ppl.h>
#endif
#endif
#undef min
#undef max
#elif defined HAVE_CSTRIPES
#include "C=.h"
#undef shared
#elif defined HAVE_OPENMP
#include <omp.h>
#elif defined HAVE_GCD
#include <dispatch/dispatch.h>
#include <pthread.h>
#elif defined WINRT && _MSC_VER < 1900
#include <ppltasks.h>
#elif defined HAVE_CONCURRENCY
#include <ppl.h>
#endif
#endif
#if defined HAVE_TBB && TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
#if defined HAVE_TBB
# define CV_PARALLEL_FRAMEWORK "tbb"
# define CV_PARALLEL_FRAMEWORK "tbb"
#elif defined HAVE_CSTRIPES
#elif defined HAVE_CSTRIPES
# define CV_PARALLEL_FRAMEWORK "cstripes"
# define CV_PARALLEL_FRAMEWORK "cstripes"
...
@@ -491,8 +484,10 @@ void cv::setNumThreads( int threads )
...
@@ -491,8 +484,10 @@ void cv::setNumThreads( int threads )
int
cv
::
getThreadNum
(
void
)
int
cv
::
getThreadNum
(
void
)
{
{
#if defined HAVE_TBB
#if defined HAVE_TBB
#if TBB_INTERFACE_VERSION >= 6100 && defined TBB_PREVIEW_TASK_ARENA && TBB_PREVIEW_TASK_ARENA
#if TBB_INTERFACE_VERSION >= 9100
return
tbb
::
task_arena
::
current_slot
();
return
tbb
::
this_task_arena
::
current_thread_index
();
#elif TBB_INTERFACE_VERSION >= 8000
return
tbb
::
task_arena
::
current_thread_index
();
#else
#else
return
0
;
return
0
;
#endif
#endif
...
...
modules/videoio/src/cap_openni.cpp
View file @
695c5183
...
@@ -44,10 +44,6 @@
...
@@ -44,10 +44,6 @@
#ifdef HAVE_OPENNI
#ifdef HAVE_OPENNI
#if defined TBB_INTERFACE_VERSION && TBB_INTERFACE_VERSION < 5000
# undef HAVE_TBB
#endif
#include <queue>
#include <queue>
#ifndef i386
#ifndef i386
...
...
modules/videoio/src/cap_openni2.cpp
View file @
695c5183
...
@@ -44,10 +44,6 @@
...
@@ -44,10 +44,6 @@
#ifdef HAVE_OPENNI2
#ifdef HAVE_OPENNI2
#if defined TBB_INTERFACE_VERSION && TBB_INTERFACE_VERSION < 5000
# undef HAVE_TBB
#endif
#include <queue>
#include <queue>
#ifndef i386
#ifndef i386
...
...
samples/gpu/driver_api_multi.cpp
View file @
695c5183
...
@@ -12,15 +12,10 @@
...
@@ -12,15 +12,10 @@
#include "opencv2/cudaarithm.hpp"
#include "opencv2/cudaarithm.hpp"
#ifdef HAVE_TBB
#ifdef HAVE_TBB
# include "tbb/tbb_stddef.h"
# include "tbb/tbb.h"
# if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
# include "tbb/task.h"
# include "tbb/tbb.h"
# undef min
# include "tbb/task.h"
# undef max
# undef min
# undef max
# else
# undef HAVE_TBB
# endif
#endif
#endif
#if !defined(HAVE_CUDA) || !defined(HAVE_TBB) || defined(__arm__)
#if !defined(HAVE_CUDA) || !defined(HAVE_TBB) || defined(__arm__)
...
...
samples/gpu/driver_api_stereo_multi.cpp
View file @
695c5183
...
@@ -14,15 +14,10 @@
...
@@ -14,15 +14,10 @@
#include "opencv2/cudastereo.hpp"
#include "opencv2/cudastereo.hpp"
#ifdef HAVE_TBB
#ifdef HAVE_TBB
# include "tbb/tbb_stddef.h"
# include "tbb/tbb.h"
# if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
# include "tbb/task.h"
# include "tbb/tbb.h"
# undef min
# include "tbb/task.h"
# undef max
# undef min
# undef max
# else
# undef HAVE_TBB
# endif
#endif
#endif
#if !defined(HAVE_CUDA) || !defined(HAVE_TBB) || defined(__arm__)
#if !defined(HAVE_CUDA) || !defined(HAVE_TBB) || defined(__arm__)
...
...
samples/gpu/multi.cpp
View file @
695c5183
...
@@ -12,15 +12,10 @@
...
@@ -12,15 +12,10 @@
#include "opencv2/cudaarithm.hpp"
#include "opencv2/cudaarithm.hpp"
#ifdef HAVE_TBB
#ifdef HAVE_TBB
# include "tbb/tbb_stddef.h"
# include "tbb/tbb.h"
# if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
# include "tbb/task.h"
# include "tbb/tbb.h"
# undef min
# include "tbb/task.h"
# undef max
# undef min
# undef max
# else
# undef HAVE_TBB
# endif
#endif
#endif
#if !defined(HAVE_CUDA) || !defined(HAVE_TBB)
#if !defined(HAVE_CUDA) || !defined(HAVE_TBB)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment