@@ -255,10 +255,6 @@ typedef union kmp_team kmp_team_p;
255
255
typedef union kmp_info kmp_info_p;
256
256
typedef union kmp_root kmp_root_p;
257
257
258
- template <bool C = false , bool S = true > class kmp_flag_32 ;
259
- template <bool C = false , bool S = true > class kmp_flag_64 ;
260
- class kmp_flag_oncore ;
261
-
262
258
#ifdef __cplusplus
263
259
extern " C" {
264
260
#endif
@@ -1322,96 +1318,6 @@ static inline void __kmp_x86_pause(void) { _mm_pause(); }
1322
1318
} \
1323
1319
}
1324
1320
1325
- // User-level Monitor/Mwait
1326
- #if KMP_HAVE_UMWAIT
1327
- // We always try for UMWAIT first
1328
- #if (KMP_COMPILER_ICC && __INTEL_COMPILER >= 1300) || \
1329
- (KMP_COMPILER_MSVC && _MSC_VER >= 1700 ) || \
1330
- (KMP_COMPILER_CLANG && (KMP_MSVC_COMPAT || __MINGW32__)) || \
1331
- (KMP_COMPILER_GCC && __MINGW32__)
1332
- #if KMP_OS_UNIX
1333
- #include < immintrin.h>
1334
- #else
1335
- #include < intrin.h>
1336
- #endif // KMP_OS_UNIX
1337
- #else
1338
- #define USE_MWAIT_ASM \
1339
- KMP_OS_UNIX && (!KMP_COMPILER_ICC || __INTEL_COMPILER < 1900 )
1340
- #endif // KMP_COMPILER_ICC etc.
1341
- #if KMP_OS_UNIX && 0 // "waitpkg" not recognized yet
1342
- __attribute__ ((target(" waitpkg" )))
1343
- #endif
1344
- static inline int
1345
- __kmp_tpause (uint32_t hint, uint64_t counter) {
1346
- #if (USE_MWAIT_ASM)
1347
- uint32_t timeHi = uint32_t (counter >> 32 );
1348
- uint32_t timeLo = uint32_t (counter & 0xffffffff );
1349
- char flag;
1350
- __asm__ volatile (" #tpause\n .byte 0x66, 0x0F, 0xAE, 0xF1\n "
1351
- " setb %0"
1352
- : " =r" (flag)
1353
- : " a" (timeLo), " d" (timeHi), " c" (hint)
1354
- :);
1355
- return flag;
1356
- #else
1357
- return _tpause (hint, counter);
1358
- #endif
1359
- }
1360
- #if KMP_OS_UNIX && 0 // "waitpkg" not recognized on our build machine
1361
- __attribute__ ((target(" waitpkg" )))
1362
- #endif
1363
- static inline void
1364
- __kmp_umonitor (void *cacheline) {
1365
- #if (USE_MWAIT_ASM)
1366
- __asm__ volatile (" # umonitor\n .byte 0xF3, 0x0F, 0xAE, 0x01 "
1367
- :
1368
- : " a" (cacheline)
1369
- :);
1370
- #else
1371
- _umonitor (cacheline);
1372
- #endif
1373
- }
1374
- #if KMP_OS_UNIX && 0 // "waitpkg" not recognized on our build machine
1375
- __attribute__ ((target(" waitpkg" )))
1376
- #endif
1377
- static inline int
1378
- __kmp_umwait (uint32_t hint, uint64_t counter) {
1379
- #if (USE_MWAIT_ASM)
1380
- uint32_t timeHi = uint32_t (counter >> 32 );
1381
- uint32_t timeLo = uint32_t (counter & 0xffffffff );
1382
- char flag;
1383
- __asm__ volatile (" #umwait\n .byte 0xF2, 0x0F, 0xAE, 0xF1\n "
1384
- " setb %0"
1385
- : " =r" (flag)
1386
- : " a" (timeLo), " d" (timeHi), " c" (hint)
1387
- :);
1388
- return flag;
1389
- #else
1390
- return _umwait (hint, counter);
1391
- #endif
1392
- }
1393
- #elif KMP_HAVE_MWAIT
1394
- #if KMP_OS_UNIX
1395
- #include < pmmintrin.h>
1396
- #else
1397
- #include < intrin.h>
1398
- #endif
1399
- #if KMP_OS_UNIX
1400
- __attribute__ ((target(" sse3" )))
1401
- #endif
1402
- static inline void
1403
- __kmp_mm_monitor (void *cacheline, unsigned extensions, unsigned hints) {
1404
- _mm_monitor (cacheline, extensions, hints);
1405
- }
1406
- #if KMP_OS_UNIX
1407
- __attribute__ ((target(" sse3" )))
1408
- #endif
1409
- static inline void
1410
- __kmp_mm_mwait (unsigned extensions, unsigned hints) {
1411
- _mm_mwait (extensions, hints);
1412
- }
1413
- #endif // KMP_HAVE_UMWAIT
1414
-
1415
1321
/* ------------------------------------------------------------------------ */
1416
1322
/* Support datatypes for the orphaned construct nesting checks. */
1417
1323
/* ------------------------------------------------------------------------ */
@@ -3188,13 +3094,6 @@ static inline void __kmp_assert_valid_gtid(kmp_int32 gtid) {
3188
3094
KMP_FATAL (ThreadIdentInvalid);
3189
3095
}
3190
3096
3191
- #if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
3192
- extern int __kmp_user_level_mwait; // TRUE or FALSE; from KMP_USER_LEVEL_MWAIT
3193
- extern int __kmp_umwait_enabled; // Runtime check if user-level mwait enabled
3194
- extern int __kmp_mwait_enabled; // Runtime check if ring3 mwait is enabled
3195
- extern int __kmp_mwait_hints; // Hints to pass in to mwait
3196
- #endif
3197
-
3198
3097
/* ------------------------------------------------------------------------- */
3199
3098
3200
3099
extern kmp_global_t __kmp_global; /* global status */
@@ -3396,14 +3295,17 @@ extern kmp_uint32 __kmp_wait_4(kmp_uint32 volatile *spinner, kmp_uint32 checker,
3396
3295
extern void __kmp_wait_4_ptr (void *spinner, kmp_uint32 checker,
3397
3296
kmp_uint32 (*pred)(void *, kmp_uint32), void *obj);
3398
3297
3399
- extern void __kmp_wait_64 (kmp_info_t *this_thr, kmp_flag_64<> *flag,
3298
+ class kmp_flag_32 ;
3299
+ class kmp_flag_64 ;
3300
+ class kmp_flag_oncore ;
3301
+ extern void __kmp_wait_64 (kmp_info_t *this_thr, kmp_flag_64 *flag,
3400
3302
int final_spin
3401
3303
#if USE_ITT_BUILD
3402
3304
,
3403
3305
void *itt_sync_obj
3404
3306
#endif
3405
3307
);
3406
- extern void __kmp_release_64 (kmp_flag_64<> *flag);
3308
+ extern void __kmp_release_64 (kmp_flag_64 *flag);
3407
3309
3408
3310
extern void __kmp_infinite_loop (void );
3409
3311
@@ -3501,6 +3403,13 @@ extern int __kmp_try_suspend_mx(kmp_info_t *th);
3501
3403
extern void __kmp_lock_suspend_mx (kmp_info_t *th);
3502
3404
extern void __kmp_unlock_suspend_mx (kmp_info_t *th);
3503
3405
3406
+ extern void __kmp_suspend_32 (int th_gtid, kmp_flag_32 *flag);
3407
+ extern void __kmp_suspend_64 (int th_gtid, kmp_flag_64 *flag);
3408
+ extern void __kmp_suspend_oncore (int th_gtid, kmp_flag_oncore *flag);
3409
+ extern void __kmp_resume_32 (int target_gtid, kmp_flag_32 *flag);
3410
+ extern void __kmp_resume_64 (int target_gtid, kmp_flag_64 *flag);
3411
+ extern void __kmp_resume_oncore (int target_gtid, kmp_flag_oncore *flag);
3412
+
3504
3413
extern void __kmp_elapsed (double *);
3505
3414
extern void __kmp_elapsed_tick (double *);
3506
3415
@@ -3625,6 +3534,28 @@ extern kmp_event_t *__kmpc_task_allow_completion_event(ident_t *loc_ref,
3625
3534
kmp_task_t *task);
3626
3535
extern void __kmp_fulfill_event (kmp_event_t *event);
3627
3536
3537
+ int __kmp_execute_tasks_32 (kmp_info_t *thread, kmp_int32 gtid,
3538
+ kmp_flag_32 *flag, int final_spin,
3539
+ int *thread_finished,
3540
+ #if USE_ITT_BUILD
3541
+ void *itt_sync_obj,
3542
+ #endif /* USE_ITT_BUILD */
3543
+ kmp_int32 is_constrained);
3544
+ int __kmp_execute_tasks_64 (kmp_info_t *thread, kmp_int32 gtid,
3545
+ kmp_flag_64 *flag, int final_spin,
3546
+ int *thread_finished,
3547
+ #if USE_ITT_BUILD
3548
+ void *itt_sync_obj,
3549
+ #endif /* USE_ITT_BUILD */
3550
+ kmp_int32 is_constrained);
3551
+ int __kmp_execute_tasks_oncore (kmp_info_t *thread, kmp_int32 gtid,
3552
+ kmp_flag_oncore *flag, int final_spin,
3553
+ int *thread_finished,
3554
+ #if USE_ITT_BUILD
3555
+ void *itt_sync_obj,
3556
+ #endif /* USE_ITT_BUILD */
3557
+ kmp_int32 is_constrained);
3558
+
3628
3559
extern void __kmp_free_task_team (kmp_info_t *thread,
3629
3560
kmp_task_team_t *task_team);
3630
3561
extern void __kmp_reap_task_teams (void );
@@ -3988,46 +3919,4 @@ extern void __kmp_omp_display_env(int verbose);
3988
3919
}
3989
3920
#endif
3990
3921
3991
- template <bool C, bool S>
3992
- extern void __kmp_suspend_32 (int th_gtid, kmp_flag_32<C, S> *flag);
3993
- template <bool C, bool S>
3994
- extern void __kmp_suspend_64 (int th_gtid, kmp_flag_64<C, S> *flag);
3995
- extern void __kmp_suspend_oncore (int th_gtid, kmp_flag_oncore *flag);
3996
- template <bool C, bool S>
3997
- #if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
3998
- extern void __kmp_mwait_32 (int th_gtid, kmp_flag_32<C, S> *flag);
3999
- template <bool C, bool S>
4000
- extern void __kmp_mwait_64 (int th_gtid, kmp_flag_64<C, S> *flag);
4001
- extern void __kmp_mwait_oncore (int th_gtid, kmp_flag_oncore *flag);
4002
- template <bool C, bool S>
4003
- #endif
4004
- extern void __kmp_resume_32 (int target_gtid, kmp_flag_32<C, S> *flag);
4005
- template <bool C, bool S>
4006
- extern void __kmp_resume_64 (int target_gtid, kmp_flag_64<C, S> *flag);
4007
- extern void __kmp_resume_oncore (int target_gtid, kmp_flag_oncore *flag);
4008
-
4009
- template <bool C, bool S>
4010
- int __kmp_execute_tasks_32 (kmp_info_t *thread, kmp_int32 gtid,
4011
- kmp_flag_32<C, S> *flag, int final_spin,
4012
- int *thread_finished,
4013
- #if USE_ITT_BUILD
4014
- void *itt_sync_obj,
4015
- #endif /* USE_ITT_BUILD */
4016
- kmp_int32 is_constrained);
4017
- template <bool C, bool S>
4018
- int __kmp_execute_tasks_64 (kmp_info_t *thread, kmp_int32 gtid,
4019
- kmp_flag_64<C, S> *flag, int final_spin,
4020
- int *thread_finished,
4021
- #if USE_ITT_BUILD
4022
- void *itt_sync_obj,
4023
- #endif /* USE_ITT_BUILD */
4024
- kmp_int32 is_constrained);
4025
- int __kmp_execute_tasks_oncore (kmp_info_t *thread, kmp_int32 gtid,
4026
- kmp_flag_oncore *flag, int final_spin,
4027
- int *thread_finished,
4028
- #if USE_ITT_BUILD
4029
- void *itt_sync_obj,
4030
- #endif /* USE_ITT_BUILD */
4031
- kmp_int32 is_constrained);
4032
-
4033
3922
#endif /* KMP_H */
0 commit comments