kmp_wait_release.cpp 1.8 KB

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