Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Employee
13 Views

Predefined macro from compiler to detect if TBB is on?

Hi,

Is there some definition from compiler or TBB include files to use in source code conditional compilation statements for TBB/non-TBB variants?

For example,

#if defined(TBB_<some_macro>)
... TBB-based code
#else
... non TBB-based code
#endif

This is not to add own definitions.

0 Kudos
2 Replies
Highlighted
13 Views

0 Kudos
Highlighted
Employee
13 Views

This works only after any of TBB include files got to preprocessor.

I probably formulated my question wrong, sorry, but I wanted to determine if user turned "Intel Performance Libraries\TBB" option in IDE to "Yes", or no.

For example, how it is in general compiler, #ifdef _WIN32 use Windows source code, if not - use Linux.

I.e.
#if defined(TBB_IS_ON) // This is for example, not a real macro ))
#include <tbb/parallel_for.h>
... other TBB stuff...
#else
...use my own multi-threading...
#endif
 

0 Kudos