Skip to content

Commit cbc3565

Browse files
committed
use tbb version major macro for deciding to use new interface
1 parent 420b2ea commit cbc3565

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

stan/math/prim/core/init_threadpool_tbb.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55

66
#include <boost/lexical_cast.hpp>
77

8+
#include <tbb/tbb_stddef.h>
9+
10+
#if TBB_VERSION_MAJOR == 2020
11+
#ifndef TBB_INTERFACE_NEW
12+
#define TBB_INTERFACE_NEW
13+
#endif
14+
#endif
15+
816
#ifdef TBB_INTERFACE_NEW
917
#include <tbb/global_control.h>
1018
#include <tbb/task_arena.h>
@@ -86,7 +94,6 @@ inline int get_num_threads() {
8694
*/
8795
inline tbb::task_arena& init_threadpool_tbb() {
8896
int tbb_max_threads = internal::get_num_threads();
89-
9097
static tbb::global_control tbb_gc(
9198
tbb::global_control::max_allowed_parallelism, tbb_max_threads);
9299

0 commit comments

Comments
 (0)