tbb_config.h

00001 /*
00002     Copyright 2005-2012 Intel Corporation.  All Rights Reserved.
00003 
00004     The source code contained or described herein and all documents related
00005     to the source code ("Material") are owned by Intel Corporation or its
00006     suppliers or licensors.  Title to the Material remains with Intel
00007     Corporation or its suppliers and licensors.  The Material is protected
00008     by worldwide copyright laws and treaty provisions.  No part of the
00009     Material may be used, copied, reproduced, modified, published, uploaded,
00010     posted, transmitted, distributed, or disclosed in any way without
00011     Intel's prior express written permission.
00012 
00013     No license under any patent, copyright, trade secret or other
00014     intellectual property right is granted to or conferred upon you by
00015     disclosure or delivery of the Materials, either expressly, by
00016     implication, inducement, estoppel or otherwise.  Any license under such
00017     intellectual property rights must be express and approved by Intel in
00018     writing.
00019 */
00020 
00021 #ifndef __TBB_tbb_config_H
00022 #define __TBB_tbb_config_H
00023 
00032 #define __TBB_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
00033 #if __clang__
00034 #define __TBB_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
00035 #endif
00036 
00039 #if (__TBB_GCC_VERSION >= 40400) && !defined(__INTEL_COMPILER)
00040 
00041     #define __TBB_GCC_WARNING_SUPPRESSION_PRESENT 1
00042 #endif
00043 
00044 
00045 /* Select particular features of C++11 based on compiler version.
00046    ICC 12.1 (Linux), GCC 4.3 and higher, clang 2.9 and higher
00047    set __GXX_EXPERIMENTAL_CXX0X__ in c++11 mode.
00048 
00049    Compilers that mimics other compilers (ICC, clang) must be processed before
00050    compilers they mimic.
00051 
00052    TODO: The following conditions should be extended when new compilers/runtimes
00053    support added.
00054  */
00055 
00056 #if __INTEL_COMPILER
00057     #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CXX0X__ && __VARIADIC_TEMPLATES
00058     #define __TBB_CPP11_RVALUE_REF_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ || _MSC_VER >= 1600) && (__INTEL_COMPILER >= 1200)
00059     #define __TBB_EXCEPTION_PTR_PRESENT 0
00060 #elif __clang__
00061     #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION >= 20900)
00062     #define __TBB_CPP11_RVALUE_REF_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_CLANG_VERSION >= 20900)
00063     #define __TBB_EXCEPTION_PTR_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00064 #elif __GNUC__
00065     #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00066     #define __TBB_CPP11_RVALUE_REF_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00067     #define __TBB_EXCEPTION_PTR_PRESENT __GXX_EXPERIMENTAL_CXX0X__
00068 #elif _MSC_VER
00069     #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 0
00070     #define __TBB_CPP11_RVALUE_REF_PRESENT 0
00071     #define __TBB_EXCEPTION_PTR_PRESENT (_MSC_VER >= 1600)
00072 #else
00073     #define __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT 0
00074     #define __TBB_CPP11_RVALUE_REF_PRESENT 0
00075     #define __TBB_EXCEPTION_PTR_PRESENT 0
00076 #endif
00077 
00078 // Work around a bug in MinGW32
00079 #if __MINGW32__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
00080     #define _GLIBCXX_ATOMIC_BUILTINS_4
00081 #endif
00082 
00083 #if __GNUC__ || __SUNPRO_CC || __IBMCPP__
00084     /* ICC defines __GNUC__ and so is covered */
00085     #define __TBB_ATTRIBUTE_ALIGNED_PRESENT 1
00086 #elif _MSC_VER && (_MSC_VER >= 1300 || __INTEL_COMPILER)
00087     #define __TBB_DECLSPEC_ALIGN_PRESENT 1
00088 #endif
00089 
00090 /* TODO: change the version back to 4.1.2 once macro __TBB_WORD_SIZE become optional */
00091 #if (__TBB_GCC_VERSION >= 40306) && !defined(__INTEL_COMPILER)
00092 
00093     #define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 1
00094 #endif
00095 
00098 #ifndef TBB_USE_DEBUG
00099 #ifdef TBB_DO_ASSERT
00100 #define TBB_USE_DEBUG TBB_DO_ASSERT
00101 #else
00102 #ifdef _DEBUG
00103 #define TBB_USE_DEBUG _DEBUG
00104 #else
00105 #define TBB_USE_DEBUG 0
00106 #endif
00107 #endif /* TBB_DO_ASSERT */
00108 #endif /* TBB_USE_DEBUG */
00109 
00110 #ifndef TBB_USE_ASSERT
00111 #ifdef TBB_DO_ASSERT
00112 #define TBB_USE_ASSERT TBB_DO_ASSERT
00113 #else 
00114 #define TBB_USE_ASSERT TBB_USE_DEBUG
00115 #endif /* TBB_DO_ASSERT */
00116 #endif /* TBB_USE_ASSERT */
00117 
00118 #ifndef TBB_USE_THREADING_TOOLS
00119 #ifdef TBB_DO_THREADING_TOOLS
00120 #define TBB_USE_THREADING_TOOLS TBB_DO_THREADING_TOOLS
00121 #else 
00122 #define TBB_USE_THREADING_TOOLS TBB_USE_DEBUG
00123 #endif /* TBB_DO_THREADING_TOOLS */
00124 #endif /* TBB_USE_THREADING_TOOLS */
00125 
00126 #ifndef TBB_USE_PERFORMANCE_WARNINGS
00127 #ifdef TBB_PERFORMANCE_WARNINGS
00128 #define TBB_USE_PERFORMANCE_WARNINGS TBB_PERFORMANCE_WARNINGS
00129 #else 
00130 #define TBB_USE_PERFORMANCE_WARNINGS TBB_USE_DEBUG
00131 #endif /* TBB_PEFORMANCE_WARNINGS */
00132 #endif /* TBB_USE_PERFORMANCE_WARNINGS */
00133 
00134 #if __MIC__ || __MIC2__
00135 #define __TBB_DEFINE_MIC 1
00136 #endif
00137 
00138 #if !defined(__EXCEPTIONS) && !defined(_CPPUNWIND) && !defined(__SUNPRO_CC) || defined(_XBOX)
00139     #if TBB_USE_EXCEPTIONS
00140         #error Compilation settings do not support exception handling. Please do not set TBB_USE_EXCEPTIONS macro or set it to 0.
00141     #elif !defined(TBB_USE_EXCEPTIONS)
00142         #define TBB_USE_EXCEPTIONS 0
00143     #endif
00144 #elif !defined(TBB_USE_EXCEPTIONS)
00145     #if __TBB_DEFINE_MIC
00146     #define TBB_USE_EXCEPTIONS 0
00147     #else
00148     #define TBB_USE_EXCEPTIONS 1
00149     #endif
00150 #elif TBB_USE_EXCEPTIONS && __TBB_DEFINE_MIC
00151     #error Please do not set TBB_USE_EXCEPTIONS macro or set it to 0.
00152 #endif
00153 
00154 #ifndef TBB_IMPLEMENT_CPP0X
00155 
00156     #if __GNUC__==4 && __GNUC_MINOR__>=4 && __GXX_EXPERIMENTAL_CXX0X__
00157         #define TBB_IMPLEMENT_CPP0X 0
00158     #else
00159         #define TBB_IMPLEMENT_CPP0X 1
00160     #endif
00161 #endif /* TBB_IMPLEMENT_CPP0X */
00162 
00163 #ifndef TBB_USE_CAPTURED_EXCEPTION
00164     #if __TBB_EXCEPTION_PTR_PRESENT
00165         #define TBB_USE_CAPTURED_EXCEPTION 0
00166     #else
00167         #define TBB_USE_CAPTURED_EXCEPTION 1
00168     #endif
00169 #else /* defined TBB_USE_CAPTURED_EXCEPTION */
00170     #if !TBB_USE_CAPTURED_EXCEPTION && !__TBB_EXCEPTION_PTR_PRESENT
00171         #error Current runtime does not support std::exception_ptr. Set TBB_USE_CAPTURED_EXCEPTION and make sure that your code is ready to catch tbb::captured_exception.
00172     #endif
00173 #endif /* defined TBB_USE_CAPTURED_EXCEPTION */
00174 
00176 #if (TBB_USE_GCC_BUILTINS && !__TBB_GCC_BUILTIN_ATOMICS_PRESENT)
00177     #error "GCC atomic built-ins are not supported."
00178 #endif
00179 
00187 #ifndef __TBB_DYNAMIC_LOAD_ENABLED
00188     #define __TBB_DYNAMIC_LOAD_ENABLED 1
00189 #elif !(_WIN32||_WIN64) && !__TBB_DYNAMIC_LOAD_ENABLED
00190     #define __TBB_WEAK_SYMBOLS 1
00191 #endif
00192 
00193 #if (_WIN32||_WIN64) && __TBB_SOURCE_DIRECTLY_INCLUDED
00194     #define __TBB_NO_IMPLICIT_LINKAGE 1
00195     #define __TBBMALLOC_NO_IMPLICIT_LINKAGE 1
00196 #endif
00197 
00198 #ifndef __TBB_COUNT_TASK_NODES
00199     #define __TBB_COUNT_TASK_NODES TBB_USE_ASSERT
00200 #endif
00201 
00202 #ifndef __TBB_TASK_GROUP_CONTEXT
00203     #define __TBB_TASK_GROUP_CONTEXT 1
00204 #endif /* __TBB_TASK_GROUP_CONTEXT */
00205 
00206 #if TBB_USE_EXCEPTIONS && !__TBB_TASK_GROUP_CONTEXT
00207     #error TBB_USE_EXCEPTIONS requires __TBB_TASK_GROUP_CONTEXT to be enabled
00208 #endif
00209 
00210 #ifndef __TBB_SCHEDULER_OBSERVER
00211     #define __TBB_SCHEDULER_OBSERVER 1
00212 #endif /* __TBB_SCHEDULER_OBSERVER */
00213 
00214 #ifndef __TBB_TASK_PRIORITY
00215     #define __TBB_TASK_PRIORITY __TBB_TASK_GROUP_CONTEXT
00216 #endif /* __TBB_TASK_PRIORITY */
00217 
00218 #if __TBB_TASK_PRIORITY && !__TBB_TASK_GROUP_CONTEXT
00219     #error __TBB_TASK_PRIORITY requires __TBB_TASK_GROUP_CONTEXT to be enabled
00220 #endif
00221 
00222 #if !defined(__TBB_SURVIVE_THREAD_SWITCH) && (_WIN32 || _WIN64 || __linux__)
00223     #define __TBB_SURVIVE_THREAD_SWITCH 1
00224 #endif /* __TBB_SURVIVE_THREAD_SWITCH */
00225 
00226 #ifndef __TBB_DEFAULT_PARTITIONER
00227 #if TBB_DEPRECATED
00228 
00229 #define __TBB_DEFAULT_PARTITIONER tbb::simple_partitioner
00230 #else
00231 
00232 #define __TBB_DEFAULT_PARTITIONER tbb::auto_partitioner
00233 #endif /* TBB_DEPRECATED */
00234 #endif /* !defined(__TBB_DEFAULT_PARTITIONER */
00235 
00236 #ifdef _VARIADIC_MAX
00237 #define __TBB_VARIADIC_MAX _VARIADIC_MAX
00238 #else
00239 #if _MSC_VER >= 1700
00240 #define __TBB_VARIADIC_MAX 5  // current VS11 setting, may change.
00241 #else
00242 #define __TBB_VARIADIC_MAX 10
00243 #endif
00244 #endif
00245 
00252 #if __GNUC__ && __TBB_x86_64 && __INTEL_COMPILER == 1200
00253     #define __TBB_ICC_12_0_INL_ASM_FSTCW_BROKEN 1
00254 #endif
00255 
00256 #if _MSC_VER && __INTEL_COMPILER && (__INTEL_COMPILER<1110 || __INTEL_COMPILER==1110 && __INTEL_COMPILER_BUILD_DATE < 20091012)
00257 
00260     #define __TBB_DEFAULT_DTOR_THROW_SPEC_BROKEN 1
00261 #endif
00262 
00263 #if defined(_MSC_VER) && _MSC_VER < 1500 && !defined(__INTEL_COMPILER)
00264 
00266     #define __TBB_TEMPLATE_FRIENDS_BROKEN 1
00267 #endif
00268 
00269 #if __GLIBC__==2 && __GLIBC_MINOR__==3 || __MINGW32__ || (__APPLE__ && __INTEL_COMPILER==1200 && !TBB_USE_DEBUG)
00271 
00272     #define __TBB_THROW_ACROSS_MODULE_BOUNDARY_BROKEN 1
00273 #endif
00274 
00275 #if (_WIN32||_WIN64) && __INTEL_COMPILER == 1110
00276 
00277     #define __TBB_ICL_11_1_CODE_GEN_BROKEN 1
00278 #endif
00279 
00280 #if __clang__ || (__GNUC__==3 && __GNUC_MINOR__==3 && !defined(__INTEL_COMPILER))
00281 
00282     #define __TBB_PROTECTED_NESTED_CLASS_BROKEN 1
00283 #endif
00284 
00285 #if __MINGW32__ && (__GNUC__<4 || __GNUC__==4 && __GNUC_MINOR__<2)
00286 
00288     #define __TBB_SSE_STACK_ALIGNMENT_BROKEN 1
00289 #endif
00290 
00291 #if __GNUC__==4 && __GNUC_MINOR__==3 && __GNUC_PATCHLEVEL__==0
00292     // GCC of this version may rashly ignore control dependencies
00293     #define __TBB_GCC_OPTIMIZER_ORDERING_BROKEN 1
00294 #endif
00295 
00296 #if __FreeBSD__
00297 
00299     #define __TBB_PRIO_INHERIT_BROKEN 1
00300 
00303     #define __TBB_PLACEMENT_NEW_EXCEPTION_SAFETY_BROKEN 1
00304 #endif /* __FreeBSD__ */
00305 
00306 #if (__linux__ || __APPLE__) && __i386__ && defined(__INTEL_COMPILER)
00307 
00309     #define __TBB_ICC_ASM_VOLATILE_BROKEN 1
00310 #endif
00311 
00312 #if !__INTEL_COMPILER && (_MSC_VER || __GNUC__==3 && __GNUC_MINOR__<=2)
00313 
00315     #define __TBB_ALIGNOF_NOT_INSTANTIATED_TYPES_BROKEN 1
00316 #endif
00317 
00318 #if __INTEL_COMPILER
00319     #define __TBB_CPP11_STD_FORWARD_BROKEN 1
00320 #else
00321     #define __TBB_CPP11_STD_FORWARD_BROKEN 0
00322 #endif
00323 
00324 #if __TBB_DEFINE_MIC
00325 
00326     #define __TBB_MAIN_THREAD_AFFINITY_BROKEN 1
00327 #endif
00328 
00329 #endif /* __TBB_tbb_config_H */

Copyright © 2005-2012 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.