@cpp-linter/clang-tidy-linux-arm64 16.0.3 → 18.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/README.md +2 -2
  2. package/bin/clang-tidy +2 -2
  3. package/lib/clang/{16 → 18}/include/__clang_cuda_device_functions.h +2 -2
  4. package/lib/clang/{16 → 18}/include/__clang_cuda_intrinsics.h +191 -0
  5. package/lib/clang/{16 → 18}/include/__clang_cuda_libdevice_declares.h +2 -2
  6. package/lib/clang/{16 → 18}/include/__clang_cuda_math.h +3 -3
  7. package/lib/clang/{16 → 18}/include/__clang_cuda_runtime_wrapper.h +2 -2
  8. package/lib/clang/{16 → 18}/include/__clang_hip_cmath.h +1 -1
  9. package/lib/clang/{16 → 18}/include/__clang_hip_libdevice_declares.h +32 -30
  10. package/lib/clang/{16 → 18}/include/__clang_hip_math.h +244 -238
  11. package/lib/clang/{16 → 18}/include/__clang_hip_runtime_wrapper.h +44 -23
  12. package/lib/clang/18/include/__stdarg___gnuc_va_list.h +13 -0
  13. package/lib/clang/18/include/__stdarg___va_copy.h +12 -0
  14. package/lib/clang/18/include/__stdarg_va_arg.h +22 -0
  15. package/lib/clang/18/include/__stdarg_va_copy.h +12 -0
  16. package/lib/clang/18/include/__stdarg_va_list.h +13 -0
  17. package/lib/clang/{16 → 18}/include/__stddef_max_align_t.h +1 -1
  18. package/lib/clang/18/include/__stddef_null.h +29 -0
  19. package/lib/clang/18/include/__stddef_nullptr_t.h +29 -0
  20. package/lib/clang/18/include/__stddef_offsetof.h +17 -0
  21. package/lib/clang/18/include/__stddef_ptrdiff_t.h +20 -0
  22. package/lib/clang/18/include/__stddef_rsize_t.h +20 -0
  23. package/lib/clang/18/include/__stddef_size_t.h +20 -0
  24. package/lib/clang/18/include/__stddef_unreachable.h +21 -0
  25. package/lib/clang/18/include/__stddef_wchar_t.h +28 -0
  26. package/lib/clang/18/include/__stddef_wint_t.h +15 -0
  27. package/lib/clang/18/include/adcintrin.h +160 -0
  28. package/lib/clang/18/include/adxintrin.h +102 -0
  29. package/lib/clang/{16 → 18}/include/altivec.h +167 -136
  30. package/lib/clang/{16 → 18}/include/ammintrin.h +4 -4
  31. package/lib/clang/18/include/amxcomplexintrin.h +169 -0
  32. package/lib/clang/{16 → 18}/include/arm_acle.h +124 -40
  33. package/lib/clang/{16 → 18}/include/arm_neon.h +249 -328
  34. package/lib/clang/18/include/arm_sme.h +2412 -0
  35. package/lib/clang/{16 → 18}/include/arm_sve.h +7454 -364
  36. package/lib/clang/18/include/arm_vector_types.h +345 -0
  37. package/lib/clang/18/include/avx2intrin.h +5284 -0
  38. package/lib/clang/{16 → 18}/include/avx512bf16intrin.h +3 -2
  39. package/lib/clang/{16 → 18}/include/avx512bitalgintrin.h +4 -1
  40. package/lib/clang/{16 → 18}/include/avx512bwintrin.h +28 -38
  41. package/lib/clang/{16 → 18}/include/avx512cdintrin.h +3 -1
  42. package/lib/clang/{16 → 18}/include/avx512dqintrin.h +4 -2
  43. package/lib/clang/{16 → 18}/include/avx512fintrin.h +24 -10
  44. package/lib/clang/{16 → 18}/include/avx512fp16intrin.h +18 -12
  45. package/lib/clang/{16 → 18}/include/avx512ifmaintrin.h +3 -1
  46. package/lib/clang/{16 → 18}/include/avx512ifmavlintrin.h +8 -2
  47. package/lib/clang/{16 → 18}/include/avx512pfintrin.h +0 -5
  48. package/lib/clang/{16 → 18}/include/avx512vbmi2intrin.h +1 -1
  49. package/lib/clang/{16 → 18}/include/avx512vbmiintrin.h +3 -2
  50. package/lib/clang/{16 → 18}/include/avx512vbmivlintrin.h +8 -3
  51. package/lib/clang/{16 → 18}/include/avx512vlbf16intrin.h +8 -6
  52. package/lib/clang/{16 → 18}/include/avx512vlbitalgintrin.h +8 -2
  53. package/lib/clang/{16 → 18}/include/avx512vlbwintrin.h +8 -2
  54. package/lib/clang/{16 → 18}/include/avx512vlcdintrin.h +8 -3
  55. package/lib/clang/{16 → 18}/include/avx512vldqintrin.h +8 -2
  56. package/lib/clang/{16 → 18}/include/avx512vlfp16intrin.h +2 -2
  57. package/lib/clang/{16 → 18}/include/avx512vlintrin.h +8 -2
  58. package/lib/clang/{16 → 18}/include/avx512vlvbmi2intrin.h +8 -2
  59. package/lib/clang/{16 → 18}/include/avx512vlvnniintrin.h +8 -2
  60. package/lib/clang/{16 → 18}/include/avx512vlvp2intersectintrin.h +6 -4
  61. package/lib/clang/{16 → 18}/include/avx512vnniintrin.h +3 -2
  62. package/lib/clang/{16 → 18}/include/avx512vp2intersectintrin.h +3 -2
  63. package/lib/clang/{16 → 18}/include/avx512vpopcntdqintrin.h +3 -1
  64. package/lib/clang/{16 → 18}/include/avx512vpopcntdqvlintrin.h +6 -2
  65. package/lib/clang/{16 → 18}/include/avxintrin.h +29 -12
  66. package/lib/clang/18/include/avxvnniint16intrin.h +473 -0
  67. package/lib/clang/18/include/bmi2intrin.h +255 -0
  68. package/lib/clang/{16 → 18}/include/bmiintrin.h +231 -46
  69. package/lib/clang/{16 → 18}/include/clflushoptintrin.h +9 -0
  70. package/lib/clang/{16 → 18}/include/clzerointrin.h +7 -5
  71. package/lib/clang/18/include/cuda_wrappers/bits/basic_string.h +9 -0
  72. package/lib/clang/18/include/cuda_wrappers/bits/basic_string.tcc +9 -0
  73. package/lib/clang/18/include/cuda_wrappers/bits/shared_ptr_base.h +9 -0
  74. package/lib/clang/{16 → 18}/include/emmintrin.h +10 -10
  75. package/lib/clang/18/include/fmaintrin.h +780 -0
  76. package/lib/clang/{16 → 18}/include/gfniintrin.h +23 -6
  77. package/lib/clang/18/include/hlsl/hlsl_intrinsics.h +624 -0
  78. package/lib/clang/18/include/ia32intrin.h +863 -0
  79. package/lib/clang/{16 → 18}/include/immintrin.h +182 -11
  80. package/lib/clang/{16 → 18}/include/intrin.h +16 -0
  81. package/lib/clang/{16 → 18}/include/larchintrin.h +13 -1
  82. package/lib/clang/18/include/lasxintrin.h +3884 -0
  83. package/lib/clang/{16 → 18}/include/limits.h +7 -5
  84. package/lib/clang/18/include/llvm_libc_wrappers/assert.h +34 -0
  85. package/lib/clang/18/include/llvm_libc_wrappers/ctype.h +102 -0
  86. package/lib/clang/18/include/llvm_libc_wrappers/inttypes.h +34 -0
  87. package/lib/clang/18/include/llvm_libc_wrappers/stdio.h +80 -0
  88. package/lib/clang/18/include/llvm_libc_wrappers/stdlib.h +45 -0
  89. package/lib/clang/18/include/llvm_libc_wrappers/string.h +96 -0
  90. package/lib/clang/18/include/llvm_libc_wrappers/time.h +34 -0
  91. package/lib/clang/18/include/lsxintrin.h +3750 -0
  92. package/lib/clang/{16 → 18}/include/mmintrin.h +7 -5
  93. package/lib/clang/{16 → 18}/include/module.modulemap +155 -2
  94. package/lib/clang/18/include/mwaitxintrin.h +62 -0
  95. package/lib/clang/{16 → 18}/include/opencl-c-base.h +8 -0
  96. package/lib/clang/{16 → 18}/include/openmp_wrappers/__clang_openmp_device_functions.h +0 -1
  97. package/lib/clang/{16 → 18}/include/openmp_wrappers/cmath +1 -1
  98. package/lib/clang/{16 → 18}/include/openmp_wrappers/new +1 -1
  99. package/lib/clang/{16 → 18}/include/pmmintrin.h +15 -8
  100. package/lib/clang/{16 → 18}/include/ppc_wrappers/emmintrin.h +2 -1
  101. package/lib/clang/18/include/ppc_wrappers/nmmintrin.h +26 -0
  102. package/lib/clang/{16 → 18}/include/ppc_wrappers/smmintrin.h +37 -17
  103. package/lib/clang/18/include/rdseedintrin.h +105 -0
  104. package/lib/clang/18/include/riscv_bitmanip.h +195 -0
  105. package/lib/clang/18/include/riscv_crypto.h +170 -0
  106. package/lib/clang/18/include/riscv_ntlh.h +26 -0
  107. package/lib/clang/18/include/riscv_vector.h +431 -0
  108. package/lib/clang/18/include/sha512intrin.h +200 -0
  109. package/lib/clang/18/include/shaintrin.h +189 -0
  110. package/lib/clang/18/include/sifive_vector.h +16 -0
  111. package/lib/clang/18/include/sm3intrin.h +238 -0
  112. package/lib/clang/18/include/sm4intrin.h +269 -0
  113. package/lib/clang/{16 → 18}/include/smmintrin.h +3 -3
  114. package/lib/clang/{16 → 18}/include/stdalign.h +3 -0
  115. package/lib/clang/18/include/stdarg.h +79 -0
  116. package/lib/clang/{16 → 18}/include/stdatomic.h +7 -2
  117. package/lib/clang/18/include/stdckdint.h +42 -0
  118. package/lib/clang/18/include/stddef.h +123 -0
  119. package/lib/clang/{16 → 18}/include/stdint.h +19 -48
  120. package/lib/clang/{16 → 18}/include/stdnoreturn.h +2 -2
  121. package/lib/clang/{16 → 18}/include/tmmintrin.h +7 -2
  122. package/lib/clang/18/include/usermsrintrin.h +51 -0
  123. package/lib/clang/{16 → 18}/include/vaesintrin.h +4 -2
  124. package/lib/clang/{16 → 18}/include/vecintrin.h +217 -199
  125. package/lib/clang/{16 → 18}/include/wasm_simd128.h +132 -12
  126. package/lib/clang/{16 → 18}/include/x86gprintrin.h +5 -0
  127. package/lib/clang/{16 → 18}/include/xmmintrin.h +9 -5
  128. package/lib/clang/18/include/xsavecintrin.h +84 -0
  129. package/package.json +6 -6
  130. package/lib/clang/16/include/adxintrin.h +0 -72
  131. package/lib/clang/16/include/avx2intrin.h +0 -1148
  132. package/lib/clang/16/include/bmi2intrin.h +0 -81
  133. package/lib/clang/16/include/fmaintrin.h +0 -216
  134. package/lib/clang/16/include/hlsl/hlsl_intrinsics.h +0 -223
  135. package/lib/clang/16/include/ia32intrin.h +0 -441
  136. package/lib/clang/16/include/mwaitxintrin.h +0 -33
  137. package/lib/clang/16/include/rdseedintrin.h +0 -42
  138. package/lib/clang/16/include/riscv_vector.h +0 -211
  139. package/lib/clang/16/include/shaintrin.h +0 -61
  140. package/lib/clang/16/include/stdarg.h +0 -51
  141. package/lib/clang/16/include/stddef.h +0 -128
  142. package/lib/clang/16/include/xsavecintrin.h +0 -34
  143. /package/lib/clang/{16 → 18}/include/__clang_cuda_builtin_vars.h +0 -0
  144. /package/lib/clang/{16 → 18}/include/__clang_cuda_cmath.h +0 -0
  145. /package/lib/clang/{16 → 18}/include/__clang_cuda_complex_builtins.h +0 -0
  146. /package/lib/clang/{16 → 18}/include/__clang_cuda_math_forward_declares.h +0 -0
  147. /package/lib/clang/{16 → 18}/include/__clang_cuda_texture_intrinsics.h +0 -0
  148. /package/lib/clang/{16 → 18}/include/__clang_hip_stdlib.h +0 -0
  149. /package/lib/clang/{16 → 18}/include/__wmmintrin_aes.h +0 -0
  150. /package/lib/clang/{16 → 18}/include/__wmmintrin_pclmul.h +0 -0
  151. /package/lib/clang/{16 → 18}/include/amxfp16intrin.h +0 -0
  152. /package/lib/clang/{16 → 18}/include/amxintrin.h +0 -0
  153. /package/lib/clang/{16 → 18}/include/arm64intr.h +0 -0
  154. /package/lib/clang/{16 → 18}/include/arm_bf16.h +0 -0
  155. /package/lib/clang/{16 → 18}/include/arm_cde.h +0 -0
  156. /package/lib/clang/{16 → 18}/include/arm_cmse.h +0 -0
  157. /package/lib/clang/{16 → 18}/include/arm_fp16.h +0 -0
  158. /package/lib/clang/{16 → 18}/include/arm_mve.h +0 -0
  159. /package/lib/clang/{16 → 18}/include/arm_neon_sve_bridge.h +0 -0
  160. /package/lib/clang/{16 → 18}/include/armintr.h +0 -0
  161. /package/lib/clang/{16 → 18}/include/avx512erintrin.h +0 -0
  162. /package/lib/clang/{16 → 18}/include/avxifmaintrin.h +0 -0
  163. /package/lib/clang/{16 → 18}/include/avxneconvertintrin.h +0 -0
  164. /package/lib/clang/{16 → 18}/include/avxvnniint8intrin.h +0 -0
  165. /package/lib/clang/{16 → 18}/include/avxvnniintrin.h +0 -0
  166. /package/lib/clang/{16 → 18}/include/builtins.h +0 -0
  167. /package/lib/clang/{16 → 18}/include/cet.h +0 -0
  168. /package/lib/clang/{16 → 18}/include/cetintrin.h +0 -0
  169. /package/lib/clang/{16 → 18}/include/cldemoteintrin.h +0 -0
  170. /package/lib/clang/{16 → 18}/include/clwbintrin.h +0 -0
  171. /package/lib/clang/{16 → 18}/include/cmpccxaddintrin.h +0 -0
  172. /package/lib/clang/{16 → 18}/include/cpuid.h +0 -0
  173. /package/lib/clang/{16 → 18}/include/crc32intrin.h +0 -0
  174. /package/lib/clang/{16 → 18}/include/cuda_wrappers/algorithm +0 -0
  175. /package/lib/clang/{16 → 18}/include/cuda_wrappers/cmath +0 -0
  176. /package/lib/clang/{16 → 18}/include/cuda_wrappers/complex +0 -0
  177. /package/lib/clang/{16 → 18}/include/cuda_wrappers/new +0 -0
  178. /package/lib/clang/{16 → 18}/include/enqcmdintrin.h +0 -0
  179. /package/lib/clang/{16 → 18}/include/f16cintrin.h +0 -0
  180. /package/lib/clang/{16 → 18}/include/float.h +0 -0
  181. /package/lib/clang/{16 → 18}/include/fma4intrin.h +0 -0
  182. /package/lib/clang/{16 → 18}/include/fxsrintrin.h +0 -0
  183. /package/lib/clang/{16 → 18}/include/hexagon_circ_brev_intrinsics.h +0 -0
  184. /package/lib/clang/{16 → 18}/include/hexagon_protos.h +0 -0
  185. /package/lib/clang/{16 → 18}/include/hexagon_types.h +0 -0
  186. /package/lib/clang/{16 → 18}/include/hlsl/hlsl_basic_types.h +0 -0
  187. /package/lib/clang/{16 → 18}/include/hlsl.h +0 -0
  188. /package/lib/clang/{16 → 18}/include/hresetintrin.h +0 -0
  189. /package/lib/clang/{16 → 18}/include/htmintrin.h +0 -0
  190. /package/lib/clang/{16 → 18}/include/htmxlintrin.h +0 -0
  191. /package/lib/clang/{16 → 18}/include/hvx_hexagon_protos.h +0 -0
  192. /package/lib/clang/{16 → 18}/include/inttypes.h +0 -0
  193. /package/lib/clang/{16 → 18}/include/invpcidintrin.h +0 -0
  194. /package/lib/clang/{16 → 18}/include/iso646.h +0 -0
  195. /package/lib/clang/{16 → 18}/include/keylockerintrin.h +0 -0
  196. /package/lib/clang/{16 → 18}/include/lwpintrin.h +0 -0
  197. /package/lib/clang/{16 → 18}/include/lzcntintrin.h +0 -0
  198. /package/lib/clang/{16 → 18}/include/mm3dnow.h +0 -0
  199. /package/lib/clang/{16 → 18}/include/mm_malloc.h +0 -0
  200. /package/lib/clang/{16 → 18}/include/movdirintrin.h +0 -0
  201. /package/lib/clang/{16 → 18}/include/msa.h +0 -0
  202. /package/lib/clang/{16 → 18}/include/nmmintrin.h +0 -0
  203. /package/lib/clang/{16 → 18}/include/opencl-c.h +0 -0
  204. /package/lib/clang/{16 → 18}/include/openmp_wrappers/complex +0 -0
  205. /package/lib/clang/{16 → 18}/include/openmp_wrappers/complex.h +0 -0
  206. /package/lib/clang/{16 → 18}/include/openmp_wrappers/complex_cmath.h +0 -0
  207. /package/lib/clang/{16 → 18}/include/openmp_wrappers/math.h +0 -0
  208. /package/lib/clang/{16 → 18}/include/pconfigintrin.h +0 -0
  209. /package/lib/clang/{16 → 18}/include/pkuintrin.h +0 -0
  210. /package/lib/clang/{16 → 18}/include/popcntintrin.h +0 -0
  211. /package/lib/clang/{16 → 18}/include/ppc_wrappers/bmi2intrin.h +0 -0
  212. /package/lib/clang/{16 → 18}/include/ppc_wrappers/bmiintrin.h +0 -0
  213. /package/lib/clang/{16 → 18}/include/ppc_wrappers/immintrin.h +0 -0
  214. /package/lib/clang/{16 → 18}/include/ppc_wrappers/mm_malloc.h +0 -0
  215. /package/lib/clang/{16 → 18}/include/ppc_wrappers/mmintrin.h +0 -0
  216. /package/lib/clang/{16 → 18}/include/ppc_wrappers/pmmintrin.h +0 -0
  217. /package/lib/clang/{16 → 18}/include/ppc_wrappers/tmmintrin.h +0 -0
  218. /package/lib/clang/{16 → 18}/include/ppc_wrappers/x86gprintrin.h +0 -0
  219. /package/lib/clang/{16 → 18}/include/ppc_wrappers/x86intrin.h +0 -0
  220. /package/lib/clang/{16 → 18}/include/ppc_wrappers/xmmintrin.h +0 -0
  221. /package/lib/clang/{16 → 18}/include/prfchiintrin.h +0 -0
  222. /package/lib/clang/{16 → 18}/include/prfchwintrin.h +0 -0
  223. /package/lib/clang/{16 → 18}/include/ptwriteintrin.h +0 -0
  224. /package/lib/clang/{16 → 18}/include/raointintrin.h +0 -0
  225. /package/lib/clang/{16 → 18}/include/rdpruintrin.h +0 -0
  226. /package/lib/clang/{16 → 18}/include/rtmintrin.h +0 -0
  227. /package/lib/clang/{16 → 18}/include/s390intrin.h +0 -0
  228. /package/lib/clang/{16 → 18}/include/serializeintrin.h +0 -0
  229. /package/lib/clang/{16 → 18}/include/sgxintrin.h +0 -0
  230. /package/lib/clang/{16 → 18}/include/stdbool.h +0 -0
  231. /package/lib/clang/{16 → 18}/include/tbmintrin.h +0 -0
  232. /package/lib/clang/{16 → 18}/include/tgmath.h +0 -0
  233. /package/lib/clang/{16 → 18}/include/tsxldtrkintrin.h +0 -0
  234. /package/lib/clang/{16 → 18}/include/uintrintrin.h +0 -0
  235. /package/lib/clang/{16 → 18}/include/unwind.h +0 -0
  236. /package/lib/clang/{16 → 18}/include/vadefs.h +0 -0
  237. /package/lib/clang/{16 → 18}/include/varargs.h +0 -0
  238. /package/lib/clang/{16 → 18}/include/velintrin.h +0 -0
  239. /package/lib/clang/{16 → 18}/include/velintrin_approx.h +0 -0
  240. /package/lib/clang/{16 → 18}/include/velintrin_gen.h +0 -0
  241. /package/lib/clang/{16 → 18}/include/vpclmulqdqintrin.h +0 -0
  242. /package/lib/clang/{16 → 18}/include/waitpkgintrin.h +0 -0
  243. /package/lib/clang/{16 → 18}/include/wbnoinvdintrin.h +0 -0
  244. /package/lib/clang/{16 → 18}/include/wmmintrin.h +0 -0
  245. /package/lib/clang/{16 → 18}/include/x86intrin.h +0 -0
  246. /package/lib/clang/{16 → 18}/include/xopintrin.h +0 -0
  247. /package/lib/clang/{16 → 18}/include/xsaveintrin.h +0 -0
  248. /package/lib/clang/{16 → 18}/include/xsaveoptintrin.h +0 -0
  249. /package/lib/clang/{16 → 18}/include/xsavesintrin.h +0 -0
  250. /package/lib/clang/{16 → 18}/include/xtestintrin.h +0 -0
@@ -52,7 +52,11 @@
52
52
  #define LONG_MIN (-__LONG_MAX__ -1L)
53
53
 
54
54
  #define UCHAR_MAX (__SCHAR_MAX__*2 +1)
55
- #define USHRT_MAX (__SHRT_MAX__ *2 +1)
55
+ #if __SHRT_WIDTH__ < __INT_WIDTH__
56
+ #define USHRT_MAX (__SHRT_MAX__ * 2 + 1)
57
+ #else
58
+ #define USHRT_MAX (__SHRT_MAX__ * 2U + 1U)
59
+ #endif
56
60
  #define UINT_MAX (__INT_MAX__ *2U +1U)
57
61
  #define ULONG_MAX (__LONG_MAX__ *2UL+1UL)
58
62
 
@@ -62,10 +66,8 @@
62
66
 
63
67
  #define CHAR_BIT __CHAR_BIT__
64
68
 
65
- /* C2x 5.2.4.2.1 */
66
- /* FIXME: This is using the placeholder dates Clang produces for these macros
67
- in C2x mode; switch to the correct values once they've been published. */
68
- #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L
69
+ /* C23 5.2.4.2.1 */
70
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
69
71
  #define BOOL_WIDTH __BOOL_WIDTH__
70
72
  #define CHAR_WIDTH CHAR_BIT
71
73
  #define SCHAR_WIDTH CHAR_BIT
@@ -0,0 +1,34 @@
1
+ //===-- Wrapper for C standard assert.h declarations on the GPU ------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef __CLANG_LLVM_LIBC_WRAPPERS_ASSERT_H__
10
+ #define __CLANG_LLVM_LIBC_WRAPPERS_ASSERT_H__
11
+
12
+ #if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
13
+ #error "This file is for GPU offloading compilation only"
14
+ #endif
15
+
16
+ #include_next <assert.h>
17
+
18
+ #if __has_include(<llvm-libc-decls/assert.h>)
19
+
20
+ #if defined(__HIP__) || defined(__CUDA__)
21
+ #define __LIBC_ATTRS __attribute__((device))
22
+ #endif
23
+
24
+ #pragma omp begin declare target
25
+
26
+ #include <llvm-libc-decls/assert.h>
27
+
28
+ #pragma omp end declare target
29
+
30
+ #undef __LIBC_ATTRS
31
+
32
+ #endif
33
+
34
+ #endif // __CLANG_LLVM_LIBC_WRAPPERS_ASSERT_H__
@@ -0,0 +1,102 @@
1
+ //===-- Wrapper for C standard ctype.h declarations on the GPU ------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__
10
+ #define __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__
11
+
12
+ #if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
13
+ #error "This file is for GPU offloading compilation only"
14
+ #endif
15
+
16
+ // The GNU headers like to define 'toupper' and 'tolower' redundantly. This is
17
+ // necessary to prevent it from doing that and remapping our implementation.
18
+ #if (defined(__NVPTX__) || defined(__AMDGPU__)) && defined(__GLIBC__)
19
+ #pragma push_macro("__USE_EXTERN_INLINES")
20
+ #undef __USE_EXTERN_INLINES
21
+ #endif
22
+
23
+ #include_next <ctype.h>
24
+
25
+ #if (defined(__NVPTX__) || defined(__AMDGPU__)) && defined(__GLIBC__)
26
+ #pragma pop_macro("__USE_EXTERN_INLINES")
27
+ #endif
28
+
29
+ #if __has_include(<llvm-libc-decls/ctype.h>)
30
+
31
+ #if defined(__HIP__) || defined(__CUDA__)
32
+ #define __LIBC_ATTRS __attribute__((device))
33
+ #endif
34
+
35
+ // The GNU headers like to provide these as macros, we need to undefine them so
36
+ // they do not conflict with the following definitions for the GPU.
37
+
38
+ #pragma push_macro("isalnum")
39
+ #pragma push_macro("isalpha")
40
+ #pragma push_macro("isascii")
41
+ #pragma push_macro("isblank")
42
+ #pragma push_macro("iscntrl")
43
+ #pragma push_macro("isdigit")
44
+ #pragma push_macro("isgraph")
45
+ #pragma push_macro("islower")
46
+ #pragma push_macro("isprint")
47
+ #pragma push_macro("ispunct")
48
+ #pragma push_macro("isspace")
49
+ #pragma push_macro("isupper")
50
+ #pragma push_macro("isxdigit")
51
+ #pragma push_macro("toascii")
52
+ #pragma push_macro("tolower")
53
+ #pragma push_macro("toupper")
54
+
55
+ #undef isalnum
56
+ #undef isalpha
57
+ #undef isascii
58
+ #undef iscntrl
59
+ #undef isdigit
60
+ #undef islower
61
+ #undef isgraph
62
+ #undef isprint
63
+ #undef ispunct
64
+ #undef isspace
65
+ #undef isupper
66
+ #undef isblank
67
+ #undef isxdigit
68
+ #undef toascii
69
+ #undef tolower
70
+ #undef toupper
71
+
72
+ #pragma omp begin declare target
73
+
74
+ #include <llvm-libc-decls/ctype.h>
75
+
76
+ #pragma omp end declare target
77
+
78
+ // Restore the original macros when compiling on the host.
79
+ #if !defined(__NVPTX__) && !defined(__AMDGPU__)
80
+ #pragma pop_macro("isalnum")
81
+ #pragma pop_macro("isalpha")
82
+ #pragma pop_macro("isascii")
83
+ #pragma pop_macro("isblank")
84
+ #pragma pop_macro("iscntrl")
85
+ #pragma pop_macro("isdigit")
86
+ #pragma pop_macro("isgraph")
87
+ #pragma pop_macro("islower")
88
+ #pragma pop_macro("isprint")
89
+ #pragma pop_macro("ispunct")
90
+ #pragma pop_macro("isspace")
91
+ #pragma pop_macro("isupper")
92
+ #pragma pop_macro("isxdigit")
93
+ #pragma pop_macro("toascii")
94
+ #pragma pop_macro("tolower")
95
+ #pragma pop_macro("toupper")
96
+ #endif
97
+
98
+ #undef __LIBC_ATTRS
99
+
100
+ #endif
101
+
102
+ #endif // __CLANG_LLVM_LIBC_WRAPPERS_CTYPE_H__
@@ -0,0 +1,34 @@
1
+ //===-- Wrapper for C standard inttypes.h declarations on the GPU ---------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef __CLANG_LLVM_LIBC_WRAPPERS_INTTYPES_H__
10
+ #define __CLANG_LLVM_LIBC_WRAPPERS_INTTYPES_H__
11
+
12
+ #if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
13
+ #error "This file is for GPU offloading compilation only"
14
+ #endif
15
+
16
+ #include_next <inttypes.h>
17
+
18
+ #if __has_include(<llvm-libc-decls/inttypes.h>)
19
+
20
+ #if defined(__HIP__) || defined(__CUDA__)
21
+ #define __LIBC_ATTRS __attribute__((device))
22
+ #endif
23
+
24
+ #pragma omp begin declare target
25
+
26
+ #include <llvm-libc-decls/inttypes.h>
27
+
28
+ #pragma omp end declare target
29
+
30
+ #undef __LIBC_ATTRS
31
+
32
+ #endif
33
+
34
+ #endif // __CLANG_LLVM_LIBC_WRAPPERS_INTTYPES_H__
@@ -0,0 +1,80 @@
1
+ //===-- Wrapper for C standard stdio.h declarations on the GPU ------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
10
+ #error "This file is for GPU offloading compilation only"
11
+ #endif
12
+
13
+ #include_next <stdio.h>
14
+
15
+ // In some old versions of glibc, other standard headers sometimes define
16
+ // special macros (e.g., __need_FILE) before including stdio.h to cause stdio.h
17
+ // to produce special definitions. Future includes of stdio.h when those
18
+ // special macros are undefined are expected to produce the normal definitions
19
+ // from stdio.h.
20
+ //
21
+ // We do not apply our include guard (__CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__)
22
+ // unconditionally to the above include_next. Otherwise, after an occurrence of
23
+ // the first glibc stdio.h use case described above, the include_next would be
24
+ // skipped for remaining includes of stdio.h, leaving required symbols
25
+ // undefined.
26
+ //
27
+ // We make the following assumptions to handle all use cases:
28
+ //
29
+ // 1. If the above include_next produces special glibc definitions, then (a) it
30
+ // does not produce the normal definitions that we must intercept below, (b)
31
+ // the current file was included from a glibc header that already defined
32
+ // __GLIBC__ (usually by including glibc's <features.h>), and (c) the above
33
+ // include_next does not define _STDIO_H. In that case, we skip the rest of
34
+ // the current file and don't guard against future includes.
35
+ // 2. If the above include_next produces the normal stdio.h definitions, then
36
+ // either (a) __GLIBC__ is not defined because C headers are from some other
37
+ // libc implementation or (b) the above include_next defines _STDIO_H to
38
+ // prevent the above include_next from having any effect in the future.
39
+ #if !defined(__GLIBC__) || defined(_STDIO_H)
40
+
41
+ #ifndef __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
42
+ #define __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
43
+
44
+ #if __has_include(<llvm-libc-decls/stdio.h>)
45
+
46
+ #if defined(__HIP__) || defined(__CUDA__)
47
+ #define __LIBC_ATTRS __attribute__((device))
48
+ #endif
49
+
50
+ // Some headers provide these as macros. Temporarily undefine them so they do
51
+ // not conflict with any definitions for the GPU.
52
+
53
+ #pragma push_macro("stdout")
54
+ #pragma push_macro("stdin")
55
+ #pragma push_macro("stderr")
56
+
57
+ #undef stdout
58
+ #undef stderr
59
+ #undef stdin
60
+
61
+ #pragma omp begin declare target
62
+
63
+ #include <llvm-libc-decls/stdio.h>
64
+
65
+ #pragma omp end declare target
66
+
67
+ #undef __LIBC_ATTRS
68
+
69
+ // Restore the original macros when compiling on the host.
70
+ #if !defined(__NVPTX__) && !defined(__AMDGPU__)
71
+ #pragma pop_macro("stdout")
72
+ #pragma pop_macro("stderr")
73
+ #pragma pop_macro("stdin")
74
+ #endif
75
+
76
+ #endif
77
+
78
+ #endif // __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
79
+
80
+ #endif
@@ -0,0 +1,45 @@
1
+ //===-- Wrapper for C standard stdlib.h declarations on the GPU -----------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef __CLANG_LLVM_LIBC_WRAPPERS_STDLIB_H__
10
+ #define __CLANG_LLVM_LIBC_WRAPPERS_STDLIB_H__
11
+
12
+ #if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
13
+ #error "This file is for GPU offloading compilation only"
14
+ #endif
15
+
16
+ #include_next <stdlib.h>
17
+
18
+ #if __has_include(<llvm-libc-decls/stdlib.h>)
19
+
20
+ #if defined(__HIP__) || defined(__CUDA__)
21
+ #define __LIBC_ATTRS __attribute__((device))
22
+ #endif
23
+
24
+ #pragma omp begin declare target
25
+
26
+ // The LLVM C library uses these named types so we forward declare them.
27
+ typedef void (*__atexithandler_t)(void);
28
+ typedef int (*__bsearchcompare_t)(const void *, const void *);
29
+ typedef int (*__qsortcompare_t)(const void *, const void *);
30
+ typedef int (*__qsortrcompare_t)(const void *, const void *, void *);
31
+
32
+ // Enforce ABI compatibility with the structs used by the LLVM C library.
33
+ _Static_assert(__builtin_offsetof(div_t, quot) == 0, "ABI mismatch!");
34
+ _Static_assert(__builtin_offsetof(ldiv_t, quot) == 0, "ABI mismatch!");
35
+ _Static_assert(__builtin_offsetof(lldiv_t, quot) == 0, "ABI mismatch!");
36
+
37
+ #include <llvm-libc-decls/stdlib.h>
38
+
39
+ #pragma omp end declare target
40
+
41
+ #undef __LIBC_ATTRS
42
+
43
+ #endif
44
+
45
+ #endif // __CLANG_LLVM_LIBC_WRAPPERS_STDLIB_H__
@@ -0,0 +1,96 @@
1
+ //===-- Wrapper for C standard string.h declarations on the GPU -----------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__
10
+ #define __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__
11
+
12
+ #if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
13
+ #error "This file is for GPU offloading compilation only"
14
+ #endif
15
+
16
+ #include_next <string.h>
17
+
18
+ #if __has_include(<llvm-libc-decls/string.h>)
19
+
20
+ #if defined(__HIP__) || defined(__CUDA__)
21
+ #define __LIBC_ATTRS __attribute__((device))
22
+ #endif
23
+
24
+ #pragma omp begin declare target
25
+
26
+ // The GNU headers provide C++ standard compliant headers when in C++ mode and
27
+ // the LLVM libc does not. We need to manually provide the definitions using the
28
+ // same prototypes.
29
+ #if defined(__cplusplus) && defined(__GLIBC__) && \
30
+ defined(__CORRECT_ISO_CPP_STRING_H_PROTO)
31
+
32
+ #ifndef __LIBC_ATTRS
33
+ #define __LIBC_ATTRS
34
+ #endif
35
+
36
+ extern "C" {
37
+ void *memccpy(void *__restrict, const void *__restrict, int,
38
+ size_t) __LIBC_ATTRS;
39
+ int memcmp(const void *, const void *, size_t) __LIBC_ATTRS;
40
+ void *memcpy(void *__restrict, const void *__restrict, size_t) __LIBC_ATTRS;
41
+ void *memmem(const void *, size_t, const void *, size_t) __LIBC_ATTRS;
42
+ void *memmove(void *, const void *, size_t) __LIBC_ATTRS;
43
+ void *mempcpy(void *__restrict, const void *__restrict, size_t) __LIBC_ATTRS;
44
+ void *memset(void *, int, size_t) __LIBC_ATTRS;
45
+ char *stpcpy(char *__restrict, const char *__restrict) __LIBC_ATTRS;
46
+ char *stpncpy(char *__restrict, const char *__restrict, size_t) __LIBC_ATTRS;
47
+ char *strcat(char *__restrict, const char *__restrict) __LIBC_ATTRS;
48
+ int strcmp(const char *, const char *) __LIBC_ATTRS;
49
+ int strcoll(const char *, const char *) __LIBC_ATTRS;
50
+ char *strcpy(char *__restrict, const char *__restrict) __LIBC_ATTRS;
51
+ size_t strcspn(const char *, const char *) __LIBC_ATTRS;
52
+ char *strdup(const char *) __LIBC_ATTRS;
53
+ size_t strlen(const char *) __LIBC_ATTRS;
54
+ char *strncat(char *__restrict, const char *__restrict, size_t) __LIBC_ATTRS;
55
+ int strncmp(const char *, const char *, size_t) __LIBC_ATTRS;
56
+ char *strncpy(char *__restrict, const char *__restrict, size_t) __LIBC_ATTRS;
57
+ char *strndup(const char *, size_t) __LIBC_ATTRS;
58
+ size_t strnlen(const char *, size_t) __LIBC_ATTRS;
59
+ size_t strspn(const char *, const char *) __LIBC_ATTRS;
60
+ char *strtok(char *__restrict, const char *__restrict) __LIBC_ATTRS;
61
+ char *strtok_r(char *__restrict, const char *__restrict,
62
+ char **__restrict) __LIBC_ATTRS;
63
+ size_t strxfrm(char *__restrict, const char *__restrict, size_t) __LIBC_ATTRS;
64
+ }
65
+
66
+ extern "C++" {
67
+ char *strstr(char *, const char *) noexcept __LIBC_ATTRS;
68
+ const char *strstr(const char *, const char *) noexcept __LIBC_ATTRS;
69
+ char *strpbrk(char *, const char *) noexcept __LIBC_ATTRS;
70
+ const char *strpbrk(const char *, const char *) noexcept __LIBC_ATTRS;
71
+ char *strrchr(char *, int) noexcept __LIBC_ATTRS;
72
+ const char *strrchr(const char *, int) noexcept __LIBC_ATTRS;
73
+ char *strchr(char *, int) noexcept __LIBC_ATTRS;
74
+ const char *strchr(const char *, int) noexcept __LIBC_ATTRS;
75
+ char *strchrnul(char *, int) noexcept __LIBC_ATTRS;
76
+ const char *strchrnul(const char *, int) noexcept __LIBC_ATTRS;
77
+ char *strcasestr(char *, const char *) noexcept __LIBC_ATTRS;
78
+ const char *strcasestr(const char *, const char *) noexcept __LIBC_ATTRS;
79
+ void *memrchr(void *__s, int __c, size_t __n) noexcept __LIBC_ATTRS;
80
+ const void *memrchr(const void *__s, int __c, size_t __n) noexcept __LIBC_ATTRS;
81
+ void *memchr(void *__s, int __c, size_t __n) noexcept __LIBC_ATTRS;
82
+ const void *memchr(const void *__s, int __c, size_t __n) noexcept __LIBC_ATTRS;
83
+ }
84
+
85
+ #else
86
+ #include <llvm-libc-decls/string.h>
87
+
88
+ #endif
89
+
90
+ #pragma omp end declare target
91
+
92
+ #undef __LIBC_ATTRS
93
+
94
+ #endif
95
+
96
+ #endif // __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__
@@ -0,0 +1,34 @@
1
+ //===-- Wrapper for C standard time.h declarations on the GPU -------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef __CLANG_LLVM_LIBC_WRAPPERS_TIME_H__
10
+ #define __CLANG_LLVM_LIBC_WRAPPERS_TIME_H__
11
+
12
+ #if !defined(_OPENMP) && !defined(__HIP__) && !defined(__CUDA__)
13
+ #error "This file is for GPU offloading compilation only"
14
+ #endif
15
+
16
+ #include_next <time.h>
17
+
18
+ #if __has_include(<llvm-libc-decls/time.h>)
19
+
20
+ #if defined(__HIP__) || defined(__CUDA__)
21
+ #define __LIBC_ATTRS __attribute__((device))
22
+ #endif
23
+
24
+ #pragma omp begin declare target
25
+
26
+ _Static_assert(sizeof(clock_t) == sizeof(long), "ABI mismatch!");
27
+
28
+ #include <llvm-libc-decls/time.h>
29
+
30
+ #pragma omp end declare target
31
+
32
+ #endif
33
+
34
+ #endif // __CLANG_LLVM_LIBC_WRAPPERS_TIME_H__