Skip to content

Commit 6a3d625

Browse files
committed
stop including tbb headers in RcppParallel headers
1 parent 019b786 commit 6a3d625

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

inst/include/RcppParallel/Common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#include <cstddef>
66
#include <cstdlib>
77

8+
#include <functional>
9+
#include <utility>
10+
811
namespace RcppParallel {
912

1013
template <typename T, typename U>

inst/include/RcppParallel/TBB.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
# define TBB_PREVIEW_GLOBAL_CONTROL 1
88
#endif
99

10-
#include <tbb/tbb.h>
11-
#include <tbb/global_control.h>
12-
#include <tbb/scalable_allocator.h>
13-
#include <tbb/task_arena.h>
14-
1510
// For compatibility with older R packages.
1611
namespace tbb {
1712

@@ -29,7 +24,7 @@ class task_scheduler_init {
2924

3025
static int default_num_threads()
3126
{
32-
return tbb::this_task_arena::max_concurrency();
27+
return 2;
3328
}
3429

3530
static const int automatic = -1;

src/tbb.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
#include <RcppParallel/Common.h>
55
#include <RcppParallel/TBB.h>
66

7+
#include <tbb/tbb.h>
8+
#include <tbb/global_control.h>
9+
#include <tbb/scalable_allocator.h>
10+
#include <tbb/task_arena.h>
11+
712
namespace RcppParallel {
813

914
tbb::global_control* s_globalControl = nullptr;

0 commit comments

Comments
 (0)