File tree 3 files changed +15
-3
lines changed 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -1228,6 +1228,7 @@ typedef struct kmp_sys_info {
1228
1228
long nivcsw; /* the number of times a context switch was forced */
1229
1229
} kmp_sys_info_t ;
1230
1230
1231
+ #if KMP_ARCH_X86 || KMP_ARCH_X86_64
1231
1232
typedef struct kmp_cpuinfo {
1232
1233
int initialized; // If 0, other fields are not initialized.
1233
1234
int signature; // CPUID(1).EAX
@@ -1243,7 +1244,7 @@ typedef struct kmp_cpuinfo {
1243
1244
kmp_uint64 frequency; // Nominal CPU frequency in Hz.
1244
1245
char name [3 *sizeof (kmp_cpuid_t )]; // CPUID(0x80000002,0x80000003,0x80000004)
1245
1246
} kmp_cpuinfo_t ;
1246
-
1247
+ # endif
1247
1248
1248
1249
#ifdef BUILD_TV
1249
1250
@@ -2666,7 +2667,9 @@ extern int __kmp_storage_map; /* True means print storage map for t
2666
2667
extern int __kmp_storage_map_verbose; /* True means storage map includes placement info */
2667
2668
extern int __kmp_storage_map_verbose_specified;
2668
2669
2670
+ #if KMP_ARCH_X86 || KMP_ARCH_X86_64
2669
2671
extern kmp_cpuinfo_t __kmp_cpuinfo;
2672
+ #endif
2670
2673
2671
2674
extern volatile int __kmp_init_serial;
2672
2675
extern volatile int __kmp_init_gtid;
Original file line number Diff line number Diff line change @@ -1174,13 +1174,20 @@ __kmp_map_hint_to_lock(uintptr_t hint)
1174
1174
#else
1175
1175
# define KMP_TSX_LOCK (seq ) __kmp_user_lock_seq
1176
1176
#endif
1177
+
1178
+ #if KMP_ARCH_X86 || KMP_ARCH_X86_64
1179
+ # define KMP_CPUINFO_RTM (__kmp_cpuinfo.rtm)
1180
+ #else
1181
+ # define KMP_CPUINFO_RTM 0
1182
+ #endif
1183
+
1177
1184
// Hints that do not require further logic
1178
1185
if (hint & kmp_lock_hint_hle )
1179
1186
return KMP_TSX_LOCK (hle );
1180
1187
if (hint & kmp_lock_hint_rtm )
1181
- return ( __kmp_cpuinfo . rtm ) ? KMP_TSX_LOCK (rtm ): __kmp_user_lock_seq ;
1188
+ return KMP_CPUINFO_RTM ? KMP_TSX_LOCK (rtm ): __kmp_user_lock_seq ;
1182
1189
if (hint & kmp_lock_hint_adaptive )
1183
- return ( __kmp_cpuinfo . rtm ) ? KMP_TSX_LOCK (adaptive ): __kmp_user_lock_seq ;
1190
+ return KMP_CPUINFO_RTM ? KMP_TSX_LOCK (adaptive ): __kmp_user_lock_seq ;
1184
1191
1185
1192
// Rule out conflicting hints first by returning the default lock
1186
1193
if ((hint & omp_lock_hint_contended ) && (hint & omp_lock_hint_uncontended ))
Original file line number Diff line number Diff line change 17
17
18
18
kmp_key_t __kmp_gtid_threadprivate_key ;
19
19
20
+ #if KMP_ARCH_X86 || KMP_ARCH_X86_64
20
21
kmp_cpuinfo_t __kmp_cpuinfo = { 0 }; // Not initialized
22
+ #endif
21
23
22
24
#if KMP_STATS_ENABLED
23
25
#include "kmp_stats.h"
You can’t perform that action at this time.
0 commit comments