From c3598bf2f6cfaa4a1964be1b6a2259aee5a43a6e Mon Sep 17 00:00:00 2001 From: FlorentLM <25004801+FlorentLM@users.noreply.github.com> Date: Tue, 25 Jul 2023 11:04:47 +0100 Subject: [PATCH 1/2] oneTBB compatibility --- apps/texrecon/texrecon.cpp | 7 ++++--- elibs/CMakeLists.txt | 2 +- elibs/tbb/FindTBB.cmake | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/texrecon/texrecon.cpp b/apps/texrecon/texrecon.cpp index 42568302..6d6d6fd5 100644 --- a/apps/texrecon/texrecon.cpp +++ b/apps/texrecon/texrecon.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include @@ -60,8 +60,9 @@ int main(int argc, char **argv) { } // Set the number of threads to use. - tbb::task_scheduler_init schedule(conf.num_threads > 0 ? conf.num_threads : tbb::task_scheduler_init::automatic); - if (conf.num_threads > 0) { + int num_threads = conf.num_threads > 0 ? conf.num_threads : oneapi::tbb::info::default_concurrency(); + + if (num_threads > 0) { omp_set_dynamic(0); omp_set_num_threads(conf.num_threads); } diff --git a/elibs/CMakeLists.txt b/elibs/CMakeLists.txt index 4c17eb8d..0e4c833e 100644 --- a/elibs/CMakeLists.txt +++ b/elibs/CMakeLists.txt @@ -1,7 +1,7 @@ externalproject_add(ext_mapmap PREFIX ext_mapmap GIT_REPOSITORY https://github.com/dthuerck/mapmap_cpu.git - GIT_TAG 55d14fd + GIT_TAG fa526e0 UPDATE_COMMAND "" SOURCE_DIR ${CMAKE_SOURCE_DIR}/elibs/mapmap CONFIGURE_COMMAND "" diff --git a/elibs/tbb/FindTBB.cmake b/elibs/tbb/FindTBB.cmake index a1131aad..cc72075a 100644 --- a/elibs/tbb/FindTBB.cmake +++ b/elibs/tbb/FindTBB.cmake @@ -184,7 +184,7 @@ if(NOT TBB_FOUND) ################################## if(TBB_INCLUDE_DIRS) - file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file) + file(READ "${TBB_INCLUDE_DIRS}/tbb/version.h" _tbb_version_file) string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" TBB_VERSION_MAJOR "${_tbb_version_file}") string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" From 2eb293df5fb35c5dfae7e59f74f2108cb9e5316f Mon Sep 17 00:00:00 2001 From: FlorentLM <25004801+FlorentLM@users.noreply.github.com> Date: Tue, 25 Jul 2023 11:22:20 +0100 Subject: [PATCH 2/2] oneTBB compatibility --- apps/texrecon/texrecon.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/texrecon/texrecon.cpp b/apps/texrecon/texrecon.cpp index 6d6d6fd5..5b132cf5 100644 --- a/apps/texrecon/texrecon.cpp +++ b/apps/texrecon/texrecon.cpp @@ -60,11 +60,12 @@ int main(int argc, char **argv) { } // Set the number of threads to use. - int num_threads = conf.num_threads > 0 ? conf.num_threads : oneapi::tbb::info::default_concurrency(); - if (num_threads > 0) { omp_set_dynamic(0); omp_set_num_threads(conf.num_threads); + } else { + omp_set_dynamic(1); + omp_set_num_threads(oneapi::tbb::info::default_concurrency()); } std::cout << "Load and prepare mesh: " << std::endl;