diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index e2aef9a1e3f..030023219a4 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -151,6 +151,9 @@ function(ov_download_tbb) if(EXISTS "${TBBROOT}/lib/cmake/TBB/TBBConfig.cmake") # oneTBB case update_deps_cache(TBB_DIR "${TBBROOT}/lib/cmake/TBB" "Path to TBB cmake folder") + elseif(EXISTS "${TBBROOT}/lib/cmake/tbb/TBBConfig.cmake") + # oneTBB release package version less than 2021.6.0 + update_deps_cache(TBB_DIR "${TBBROOT}/lib/cmake/tbb" "Path to TBB cmake folder") elseif(EXISTS "${TBBROOT}/lib64/cmake/TBB/TBBConfig.cmake") # 64-bits oneTBB case update_deps_cache(TBB_DIR "${TBBROOT}/lib64/cmake/TBB" "Path to TBB cmake folder") diff --git a/cmake/templates/OpenVINOConfig.cmake.in b/cmake/templates/OpenVINOConfig.cmake.in index c3e6d2ca030..5bdddc178a6 100644 --- a/cmake/templates/OpenVINOConfig.cmake.in +++ b/cmake/templates/OpenVINOConfig.cmake.in @@ -160,6 +160,7 @@ if((THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") AND NOT TBB_FOUND # oneTBB case exposed via export TBBROOT= "${ENV_TBBROOT}/lib64/cmake/TBB" "${ENV_TBBROOT}/lib/cmake/TBB" + "${ENV_TBBROOT}/lib/cmake/tbb" # "$ENV{TBB_DIR}" # for custom TBB exposed via cmake -DTBBROOT= "${TBBROOT}/cmake" diff --git a/scripts/setupvars/setupvars.sh b/scripts/setupvars/setupvars.sh index 27f4a10493c..5b294a311b4 100755 --- a/scripts/setupvars/setupvars.sh +++ b/scripts/setupvars/setupvars.sh @@ -55,6 +55,8 @@ if [ -e "$INSTALLDIR/runtime/3rdparty/tbb" ]; then if [ -e "$INSTALLDIR/runtime/3rdparty/tbb/lib/cmake/TBB" ]; then export TBB_DIR=$INSTALLDIR/runtime/3rdparty/tbb/lib/cmake/TBB + elif [ -e "$INSTALLDIR/runtime/3rdparty/tbb/lib/cmake/tbb" ]; then + export TBB_DIR=$INSTALLDIR/runtime/3rdparty/tbb/lib/cmake/tbb elif [ -e "$INSTALLDIR/runtime/3rdparty/tbb/lib64/cmake/TBB" ]; then export TBB_DIR=$INSTALLDIR/runtime/3rdparty/tbb/lib64/cmake/TBB elif [ -e "$INSTALLDIR/runtime/3rdparty/tbb/cmake" ]; then diff --git a/src/inference/include/ie/ie_parallel.hpp b/src/inference/include/ie/ie_parallel.hpp index a401931eecb..6199acce63d 100644 --- a/src/inference/include/ie/ie_parallel.hpp +++ b/src/inference/include/ie/ie_parallel.hpp @@ -29,6 +29,9 @@ # ifndef TBB_PREVIEW_LOCAL_OBSERVER # define TBB_PREVIEW_LOCAL_OBSERVER 1 # endif +# ifndef TBB_PREVIEW_WAITING_FOR_WORKERS +# define TBB_PREVIEW_WAITING_FOR_WORKERS 1 +# endif # ifndef TBB_PREVIEW_NUMA_SUPPORT # define TBB_PREVIEW_NUMA_SUPPORT 1 # endif diff --git a/src/inference/src/threading/ie_executor_manager.cpp b/src/inference/src/threading/ie_executor_manager.cpp index 2295d2ed2ca..4f630c12144 100644 --- a/src/inference/src/threading/ie_executor_manager.cpp +++ b/src/inference/src/threading/ie_executor_manager.cpp @@ -64,6 +64,9 @@ void ExecutorManagerImpl::setTbbFlag(bool flag) { if (!tbbTaskScheduler) { # if (TBB_INTERFACE_VERSION < 12000) tbbTaskScheduler = std::make_shared(); +# elif (TBB_INTERFACE_VERSION < 12060) + tbbTaskScheduler = + std::make_shared(oneapi::tbb::task_scheduler_handle::get()); # else tbbTaskScheduler = std::make_shared(tbb::attach{}); # endif diff --git a/src/tests/functional/inference_engine/CMakeLists.txt b/src/tests/functional/inference_engine/CMakeLists.txt index ef19096d7c8..b48b6e514b7 100644 --- a/src/tests/functional/inference_engine/CMakeLists.txt +++ b/src/tests/functional/inference_engine/CMakeLists.txt @@ -282,8 +282,8 @@ ie_headers_compilation_with_custom_flags(TEST_SUFFIX PluginApiCxx17 CXX_STANDARD 17 PLUGIN_API) if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) - if(TBB_VERSION VERSION_EQUAL 2021.2) - # TBB 2021.2 has a bug in headers with CXX_STANDARD 20 + if(TBB_VERSION VERSION_EQUAL 2021.2.2) + # TBB 2021.2.2 has a bug in headers with CXX_STANDARD 20 # see https://github.com/oneapi-src/oneTBB/issues/379 set(skip_headers_list HEADERS_TO_SKIP "threading/ie_thread_local.hpp") endif()