Predefined macro from compiler to detect if TBB is on?

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.

Regards,
Sergey
3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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
 

Regards,
Sergey

Leave a Comment

Please sign in to add a comment. Not a member? Join today