libgomp_f.h.in 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* Copyright (C) 2005-2022 Free Software Foundation, Inc.
  2. Contributed by Jakub Jelinek <jakub@redhat.com>.
  3. This file is part of the GNU Offloading and Multi Processing Library
  4. (libgomp).
  5. Libgomp is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. more details.
  13. Under Section 7 of GPL version 3, you are granted additional
  14. permissions described in the GCC Runtime Library Exception, version
  15. 3.1, as published by the Free Software Foundation.
  16. You should have received a copy of the GNU General Public License and
  17. a copy of the GCC Runtime Library Exception along with this program;
  18. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. <http://www.gnu.org/licenses/>. */
  20. /* This file contains prototypes of functions in the external ABI.
  21. This file is included by files in the testsuite. */
  22. #ifndef LIBGOMP_F_H
  23. #define LIBGOMP_F_H 1
  24. #include "libgomp.h"
  25. #if (@OMP_LOCK_SIZE@ == @OMP_LOCK_KIND@) \
  26. && (@OMP_LOCK_ALIGN@ <= @OMP_LOCK_SIZE@)
  27. # define OMP_LOCK_DIRECT
  28. typedef omp_lock_t *omp_lock_arg_t;
  29. # define omp_lock_arg(arg) (arg)
  30. #else
  31. typedef union { omp_lock_t *lock; uint64_t u; } *omp_lock_arg_t;
  32. # define omp_lock_arg(arg) ((arg)->lock)
  33. # endif
  34. #if (@OMP_NEST_LOCK_SIZE@ == @OMP_NEST_LOCK_KIND@) \
  35. && (@OMP_NEST_LOCK_ALIGN@ <= @OMP_NEST_LOCK_SIZE@)
  36. # define OMP_NEST_LOCK_DIRECT
  37. typedef omp_nest_lock_t *omp_nest_lock_arg_t;
  38. # define omp_nest_lock_arg(arg) (arg)
  39. #else
  40. typedef union { omp_nest_lock_t *lock; uint64_t u; } *omp_nest_lock_arg_t;
  41. # define omp_nest_lock_arg(arg) ((arg)->lock)
  42. # endif
  43. #if (@OMP_LOCK_25_SIZE@ == @OMP_LOCK_25_KIND@) \
  44. && (@OMP_LOCK_25_ALIGN@ <= @OMP_LOCK_25_SIZE@)
  45. # define OMP_LOCK_25_DIRECT
  46. typedef omp_lock_25_t *omp_lock_25_arg_t;
  47. # define omp_lock_25_arg(arg) (arg)
  48. #else
  49. typedef union { omp_lock_25_t *lock; uint64_t u; } *omp_lock_25_arg_t;
  50. # define omp_lock_25_arg(arg) ((arg)->lock)
  51. # endif
  52. #if (@OMP_NEST_LOCK_25_SIZE@ == @OMP_NEST_LOCK_25_KIND@) \
  53. && (@OMP_NEST_LOCK_25_ALIGN@ <= @OMP_NEST_LOCK_25_SIZE@)
  54. # define OMP_NEST_LOCK_25_DIRECT
  55. typedef omp_nest_lock_25_t *omp_nest_lock_25_arg_t;
  56. # define omp_nest_lock_25_arg(arg) (arg)
  57. #else
  58. typedef union { omp_nest_lock_25_t *lock; uint64_t u; } *omp_nest_lock_25_arg_t;
  59. # define omp_nest_lock_25_arg(arg) ((arg)->lock)
  60. # endif
  61. static inline void
  62. omp_check_defines (void)
  63. {
  64. char test[(@OMP_LOCK_SIZE@ != sizeof (omp_lock_t)
  65. || @OMP_LOCK_ALIGN@ != __alignof (omp_lock_t)
  66. || @OMP_NEST_LOCK_SIZE@ != sizeof (omp_nest_lock_t)
  67. || @OMP_NEST_LOCK_ALIGN@ != __alignof (omp_nest_lock_t)
  68. || @OMP_LOCK_KIND@ != sizeof (*(omp_lock_arg_t) 0)
  69. || @OMP_NEST_LOCK_KIND@ != sizeof (*(omp_nest_lock_arg_t) 0)
  70. || @INTPTR_T_KIND@ != sizeof (omp_allocator_handle_t)
  71. || 4 != sizeof (omp_alloctrait_key_t)
  72. || @INTPTR_T_KIND@ != sizeof (omp_alloctrait_value_t)
  73. || @INTPTR_T_KIND@ != sizeof (omp_memspace_handle_t)
  74. || @OMP_DEPEND_KIND@ != sizeof (omp_depend_t))
  75. ? -1 : 1] __attribute__ ((__unused__));
  76. char test2[(@OMP_LOCK_25_SIZE@ != sizeof (omp_lock_25_t)
  77. || @OMP_LOCK_25_ALIGN@ != __alignof (omp_lock_25_t)
  78. || @OMP_NEST_LOCK_25_SIZE@ != sizeof (omp_nest_lock_25_t)
  79. || @OMP_NEST_LOCK_25_ALIGN@ != __alignof (omp_nest_lock_25_t)
  80. || @OMP_LOCK_25_KIND@ != sizeof (*(omp_lock_25_arg_t) 0)
  81. || @OMP_NEST_LOCK_25_KIND@
  82. != sizeof (*(omp_nest_lock_25_arg_t) 0))
  83. ? -1 : 1] __attribute__ ((__unused__));
  84. }
  85. #endif /* LIBGOMP_F_H */