Skip to content

Commit

Permalink
Fixed oneTBB compatibility based on: nmoehrle#211.
Browse files Browse the repository at this point in the history
  • Loading branch information
donlk committed Jun 15, 2024
1 parent de5e3af commit 5e0d553
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions apps/texrecon/texrecon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <iostream>
#include <fstream>
#include <vector>
#include <tbb/task_scheduler_init.h>
#include <oneapi/tbb/info.h>
#include <omp.h>

#include <util/timer.h>
Expand Down Expand Up @@ -60,8 +60,8 @@ 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);
}
Expand Down
2 changes: 1 addition & 1 deletion elibs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 ""
Expand Down
2 changes: 1 addition & 1 deletion elibs/tbb/FindTBB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion libs/tex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set(LIBRARY tex)
add_library(${LIBRARY} STATIC ${SOURCES})
set_property(TARGET ${LIBRARY} PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
add_dependencies(${LIBRARY} ext_rayint ext_mapmap)
target_link_libraries(${LIBRARY} ${TBB_LIBRARIES} -lmve -lmve_util ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES})
target_link_libraries(${LIBRARY} ${TBB_LIBRARIES} -lmve -lmve_util tbb ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${TIFF_LIBRARIES})
install(TARGETS ${LIBRARY} ARCHIVE DESTINATION lib)

0 comments on commit 5e0d553

Please sign in to comment.