21 #if !defined(__TBB_machine_H) || defined(__TBB_msvc_armv7_H) 22 #error Do not #include this internal file directly; use public TBB headers instead. 25 #define __TBB_msvc_armv7_H 30 #define __TBB_WORDSIZE 4 32 #define __TBB_ENDIANNESS __TBB_ENDIAN_UNSUPPORTED 34 #if defined(TBB_WIN32_USE_CL_BUILTINS) 36 #pragma intrinsic(_ReadWriteBarrier) 37 #pragma intrinsic(_mm_mfence) 38 #define __TBB_compiler_fence() _ReadWriteBarrier() 39 #define __TBB_full_memory_fence() _mm_mfence() 40 #define __TBB_control_consistency_helper() __TBB_compiler_fence() 41 #define __TBB_acquire_consistency_helper() __TBB_compiler_fence() 42 #define __TBB_release_consistency_helper() __TBB_compiler_fence() 46 #define __TBB_compiler_fence() __dmb(_ARM_BARRIER_SY) 47 #define __TBB_full_memory_fence() __dmb(_ARM_BARRIER_SY) 48 #define __TBB_control_consistency_helper() __TBB_compiler_fence() 49 #define __TBB_acquire_consistency_helper() __TBB_full_memory_fence() 50 #define __TBB_release_consistency_helper() __TBB_full_memory_fence() 65 #define __TBB_MACHINE_DEFINE_ATOMICS_CMPSWP(S,T,F) \ 66 inline T __TBB_machine_cmpswp##S( volatile void *ptr, T value, T comparand ) { \ 67 return _InterlockedCompareExchange##F(reinterpret_cast<volatile T *>(ptr),value,comparand); \ 70 #define __TBB_MACHINE_DEFINE_ATOMICS_FETCHADD(S,T,F) \ 71 inline T __TBB_machine_fetchadd##S( volatile void *ptr, T value ) { \ 72 return _InterlockedExchangeAdd##F(reinterpret_cast<volatile T *>(ptr),value); \ 75 __TBB_MACHINE_DEFINE_ATOMICS_CMPSWP(1,
char,8)
76 __TBB_MACHINE_DEFINE_ATOMICS_CMPSWP(2,
short,16)
77 __TBB_MACHINE_DEFINE_ATOMICS_CMPSWP(4,
long,)
78 __TBB_MACHINE_DEFINE_ATOMICS_CMPSWP(8,__int64,64)
79 __TBB_MACHINE_DEFINE_ATOMICS_FETCHADD(4,
long,)
80 #if defined(TBB_WIN32_USE_CL_BUILTINS) 82 #define __TBB_64BIT_ATOMICS 0 84 __TBB_MACHINE_DEFINE_ATOMICS_FETCHADD(8,__int64,64)
87 inline void __TBB_machine_pause (int32_t delay )
91 __TBB_compiler_fence();
97 #define __TBB_CPU_CTL_ENV_PRESENT 1 102 template <
typename T,
size_t S>
103 struct machine_load_store_relaxed {
104 static inline T load (
const volatile T& location ) {
105 const T value = location;
111 __TBB_acquire_consistency_helper();
115 static inline void store (
volatile T& location, T value ) {
124 bool operator!=(
const cpu_ctl_env& ctl )
const {
return my_ctl != ctl.my_ctl; }
125 void get_env() { my_ctl = _control87(0, 0); }
126 void set_env()
const { _control87( my_ctl, ~0U ); }
133 #define __TBB_CompareAndSwap4(P,V,C) __TBB_machine_cmpswp4(P,V,C) 134 #define __TBB_CompareAndSwap8(P,V,C) __TBB_machine_cmpswp8(P,V,C) 135 #define __TBB_Pause(V) __TBB_machine_pause(V) 138 #define __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE 1 139 #define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1 140 #define __TBB_USE_GENERIC_PART_WORD_FETCH_ADD 1 141 #define __TBB_USE_GENERIC_PART_WORD_FETCH_STORE 1 142 #define __TBB_USE_GENERIC_FETCH_STORE 1 143 #define __TBB_USE_GENERIC_DWORD_LOAD_STORE 1 144 #define __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE 1 146 #if defined(TBB_WIN32_USE_CL_BUILTINS) 147 #if !__TBB_WIN8UI_SUPPORT 148 extern "C" __declspec(dllimport) int __stdcall SwitchToThread(
void );
149 #define __TBB_Yield() SwitchToThread() 152 #define __TBB_Yield() std::this_thread::yield() 155 #define __TBB_Yield() __yield() 159 #define __TBB_AtomicOR(P,V) __TBB_machine_OR(P,V) 160 #define __TBB_AtomicAND(P,V) __TBB_machine_AND(P,V) 162 template <
typename T1,
typename T2>
163 inline void __TBB_machine_OR( T1 *operand, T2 addend ) {
164 _InterlockedOr((
long volatile *)operand, (
long)addend);
167 template <
typename T1,
typename T2>
168 inline void __TBB_machine_AND( T1 *operand, T2 addend ) {
169 _InterlockedAnd((
long volatile *)operand, (
long)addend);
Definition: _flow_graph_async_msg_impl.h:32
The namespace tbb contains all components of the library.
Definition: parallel_for.h:44