14cc4bb4cSJim Cownie /*
24cc4bb4cSJim Cownie  * kmp_wait_release.cpp -- Wait/Release implementation
34cc4bb4cSJim Cownie  */
44cc4bb4cSJim Cownie 
54cc4bb4cSJim Cownie //===----------------------------------------------------------------------===//
64cc4bb4cSJim Cownie //
757b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
857b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
957b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
104cc4bb4cSJim Cownie //
114cc4bb4cSJim Cownie //===----------------------------------------------------------------------===//
124cc4bb4cSJim Cownie 
134cc4bb4cSJim Cownie #include "kmp_wait_release.h"
144cc4bb4cSJim Cownie 
__kmp_wait_64(kmp_info_t * this_thr,kmp_flag_64<> * flag,int final_spin USE_ITT_BUILD_ARG (void * itt_sync_obj))15e0665a90STerry Wilmarth void __kmp_wait_64(kmp_info_t *this_thr, kmp_flag_64<> *flag,
163041982dSJonathan Peyton                    int final_spin USE_ITT_BUILD_ARG(void *itt_sync_obj)) {
17a764af68SJonathan Peyton   if (final_spin)
18e0665a90STerry Wilmarth     __kmp_wait_template<kmp_flag_64<>, TRUE>(
19a764af68SJonathan Peyton         this_thr, flag USE_ITT_BUILD_ARG(itt_sync_obj));
20a764af68SJonathan Peyton   else
21e0665a90STerry Wilmarth     __kmp_wait_template<kmp_flag_64<>, FALSE>(
22a764af68SJonathan Peyton         this_thr, flag USE_ITT_BUILD_ARG(itt_sync_obj));
234cc4bb4cSJim Cownie }
244cc4bb4cSJim Cownie 
__kmp_release_64(kmp_flag_64<> * flag)25e0665a90STerry Wilmarth void __kmp_release_64(kmp_flag_64<> *flag) { __kmp_release_template(flag); }
26e0665a90STerry Wilmarth 
27e0665a90STerry Wilmarth #if KMP_HAVE_MWAIT || KMP_HAVE_UMWAIT
28e0665a90STerry Wilmarth template <bool C, bool S>
__kmp_mwait_32(int th_gtid,kmp_flag_32<C,S> * flag)29e0665a90STerry Wilmarth void __kmp_mwait_32(int th_gtid, kmp_flag_32<C, S> *flag) {
30e0665a90STerry Wilmarth   __kmp_mwait_template(th_gtid, flag);
31e0665a90STerry Wilmarth }
32e0665a90STerry Wilmarth template <bool C, bool S>
__kmp_mwait_64(int th_gtid,kmp_flag_64<C,S> * flag)33e0665a90STerry Wilmarth void __kmp_mwait_64(int th_gtid, kmp_flag_64<C, S> *flag) {
34e0665a90STerry Wilmarth   __kmp_mwait_template(th_gtid, flag);
35e0665a90STerry Wilmarth }
36*d8e4cb91STerry Wilmarth template <bool C, bool S>
__kmp_atomic_mwait_64(int th_gtid,kmp_atomic_flag_64<C,S> * flag)37*d8e4cb91STerry Wilmarth void __kmp_atomic_mwait_64(int th_gtid, kmp_atomic_flag_64<C, S> *flag) {
38*d8e4cb91STerry Wilmarth   __kmp_mwait_template(th_gtid, flag);
39*d8e4cb91STerry Wilmarth }
__kmp_mwait_oncore(int th_gtid,kmp_flag_oncore * flag)40e0665a90STerry Wilmarth void __kmp_mwait_oncore(int th_gtid, kmp_flag_oncore *flag) {
41e0665a90STerry Wilmarth   __kmp_mwait_template(th_gtid, flag);
42e0665a90STerry Wilmarth }
43e0665a90STerry Wilmarth 
44e0665a90STerry Wilmarth template void __kmp_mwait_32<false, false>(int, kmp_flag_32<false, false> *);
45e0665a90STerry Wilmarth template void __kmp_mwait_64<false, true>(int, kmp_flag_64<false, true> *);
46e0665a90STerry Wilmarth template void __kmp_mwait_64<true, false>(int, kmp_flag_64<true, false> *);
47*d8e4cb91STerry Wilmarth template void
48*d8e4cb91STerry Wilmarth __kmp_atomic_mwait_64<false, true>(int, kmp_atomic_flag_64<false, true> *);
49*d8e4cb91STerry Wilmarth template void
50*d8e4cb91STerry Wilmarth __kmp_atomic_mwait_64<true, false>(int, kmp_atomic_flag_64<true, false> *);
51e0665a90STerry Wilmarth #endif
52