xref: /freebsd/contrib/llvm-project/openmp/runtime/src/kmp_wait_release.cpp (revision 271171e0d97b88ba2a7c3bf750c9672b484c1c13)
1 /*
2  * kmp_wait_release.cpp -- Wait/Release implementation
3  */
4 
5 //===----------------------------------------------------------------------===//
6 //
7 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
8 // See https://llvm.org/LICENSE.txt for license information.
9 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "kmp_wait_release.h"
14 
15 void __kmp_wait_64(kmp_info_t *this_thr, kmp_flag_64<> *flag,
16                    int final_spin USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
17   if (final_spin)
18     __kmp_wait_template<kmp_flag_64<>, TRUE>(
19         this_thr, flag USE_ITT_BUILD_ARG(itt_sync_obj));
20   else
21     __kmp_wait_template<kmp_flag_64<>, FALSE>(
22         this_thr, flag USE_ITT_BUILD_ARG(itt_sync_obj));
23 }
24 
25 void __kmp_release_64(kmp_flag_64<> *flag) { __kmp_release_template(flag); }
26 
27 #if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
28 template <bool C, bool S>
29 void __kmp_mwait_32(int th_gtid, kmp_flag_32<C, S> *flag) {
30   __kmp_mwait_template(th_gtid, flag);
31 }
32 template <bool C, bool S>
33 void __kmp_mwait_64(int th_gtid, kmp_flag_64<C, S> *flag) {
34   __kmp_mwait_template(th_gtid, flag);
35 }
36 template <bool C, bool S>
37 void __kmp_atomic_mwait_64(int th_gtid, kmp_atomic_flag_64<C, S> *flag) {
38   __kmp_mwait_template(th_gtid, flag);
39 }
40 void __kmp_mwait_oncore(int th_gtid, kmp_flag_oncore *flag) {
41   __kmp_mwait_template(th_gtid, flag);
42 }
43 
44 template void __kmp_mwait_32<false, false>(int, kmp_flag_32<false, false> *);
45 template void __kmp_mwait_64<false, true>(int, kmp_flag_64<false, true> *);
46 template void __kmp_mwait_64<true, false>(int, kmp_flag_64<true, false> *);
47 template void
48 __kmp_atomic_mwait_64<false, true>(int, kmp_atomic_flag_64<false, true> *);
49 template void
50 __kmp_atomic_mwait_64<true, false>(int, kmp_atomic_flag_64<true, false> *);
51 #endif
52