Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oneTBB compatibility #211

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 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,10 +60,12 @@ 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) {
if (num_threads > 0) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mvs-texturing/apps/texrecon/texrecon.cpp:63:9: error: ‘num_threads’ was not declared in this scope
   63 |     if (num_threads > 0) {

should be:

if (conf.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;
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