@nativescript/linux 0.0.0-stage → 0.1.0-alpha.0

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 (238) hide show
  1. package/framework/App_Resources/Linux/app.desktop +8 -0
  2. package/framework/App_Resources/Linux/app.metainfo.xml +15 -0
  3. package/framework/App_Resources/Linux/icon.png +0 -0
  4. package/framework/App_Resources/Linux/images/.gitkeep +0 -0
  5. package/framework/__PROJECT_NAME__/app/.gitkeep +0 -0
  6. package/framework/runtime/x64/metadata-x86_64.bin +0 -0
  7. package/framework/runtime/x64/ns-linux +4 -0
  8. package/framework/tools/x64/lib/clang/17/include/__clang_cuda_builtin_vars.h +121 -0
  9. package/framework/tools/x64/lib/clang/17/include/__clang_cuda_cmath.h +512 -0
  10. package/framework/tools/x64/lib/clang/17/include/__clang_cuda_complex_builtins.h +285 -0
  11. package/framework/tools/x64/lib/clang/17/include/__clang_cuda_device_functions.h +1558 -0
  12. package/framework/tools/x64/lib/clang/17/include/__clang_cuda_intrinsics.h +709 -0
  13. package/framework/tools/x64/lib/clang/17/include/__clang_cuda_libdevice_declares.h +468 -0
  14. package/framework/tools/x64/lib/clang/17/include/__clang_cuda_math.h +348 -0
  15. package/framework/tools/x64/lib/clang/17/include/__clang_cuda_math_forward_declares.h +284 -0
  16. package/framework/tools/x64/lib/clang/17/include/__clang_cuda_runtime_wrapper.h +503 -0
  17. package/framework/tools/x64/lib/clang/17/include/__clang_cuda_texture_intrinsics.h +742 -0
  18. package/framework/tools/x64/lib/clang/17/include/__clang_hip_cmath.h +842 -0
  19. package/framework/tools/x64/lib/clang/17/include/__clang_hip_libdevice_declares.h +353 -0
  20. package/framework/tools/x64/lib/clang/17/include/__clang_hip_math.h +1303 -0
  21. package/framework/tools/x64/lib/clang/17/include/__clang_hip_runtime_wrapper.h +151 -0
  22. package/framework/tools/x64/lib/clang/17/include/__clang_hip_stdlib.h +43 -0
  23. package/framework/tools/x64/lib/clang/17/include/__stddef_max_align_t.h +27 -0
  24. package/framework/tools/x64/lib/clang/17/include/__wmmintrin_aes.h +140 -0
  25. package/framework/tools/x64/lib/clang/17/include/__wmmintrin_pclmul.h +48 -0
  26. package/framework/tools/x64/lib/clang/17/include/adxintrin.h +227 -0
  27. package/framework/tools/x64/lib/clang/17/include/altivec.h +19342 -0
  28. package/framework/tools/x64/lib/clang/17/include/ammintrin.h +183 -0
  29. package/framework/tools/x64/lib/clang/17/include/amxcomplexintrin.h +169 -0
  30. package/framework/tools/x64/lib/clang/17/include/amxfp16intrin.h +58 -0
  31. package/framework/tools/x64/lib/clang/17/include/amxintrin.h +524 -0
  32. package/framework/tools/x64/lib/clang/17/include/arm64intr.h +35 -0
  33. package/framework/tools/x64/lib/clang/17/include/arm_acle.h +782 -0
  34. package/framework/tools/x64/lib/clang/17/include/arm_bf16.h +20 -0
  35. package/framework/tools/x64/lib/clang/17/include/arm_cde.h +410 -0
  36. package/framework/tools/x64/lib/clang/17/include/arm_cmse.h +217 -0
  37. package/framework/tools/x64/lib/clang/17/include/arm_fp16.h +596 -0
  38. package/framework/tools/x64/lib/clang/17/include/arm_mve.h +19187 -0
  39. package/framework/tools/x64/lib/clang/17/include/arm_neon.h +69885 -0
  40. package/framework/tools/x64/lib/clang/17/include/arm_neon_sve_bridge.h +182 -0
  41. package/framework/tools/x64/lib/clang/17/include/arm_sme_draft_spec_subject_to_change.h +642 -0
  42. package/framework/tools/x64/lib/clang/17/include/arm_sve.h +23950 -0
  43. package/framework/tools/x64/lib/clang/17/include/armintr.h +31 -0
  44. package/framework/tools/x64/lib/clang/17/include/avx2intrin.h +5263 -0
  45. package/framework/tools/x64/lib/clang/17/include/avx512bf16intrin.h +282 -0
  46. package/framework/tools/x64/lib/clang/17/include/avx512bitalgintrin.h +83 -0
  47. package/framework/tools/x64/lib/clang/17/include/avx512bwintrin.h +2024 -0
  48. package/framework/tools/x64/lib/clang/17/include/avx512cdintrin.h +123 -0
  49. package/framework/tools/x64/lib/clang/17/include/avx512dqintrin.h +1377 -0
  50. package/framework/tools/x64/lib/clang/17/include/avx512erintrin.h +271 -0
  51. package/framework/tools/x64/lib/clang/17/include/avx512fintrin.h +9775 -0
  52. package/framework/tools/x64/lib/clang/17/include/avx512fp16intrin.h +3350 -0
  53. package/framework/tools/x64/lib/clang/17/include/avx512ifmaintrin.h +68 -0
  54. package/framework/tools/x64/lib/clang/17/include/avx512ifmavlintrin.h +105 -0
  55. package/framework/tools/x64/lib/clang/17/include/avx512pfintrin.h +97 -0
  56. package/framework/tools/x64/lib/clang/17/include/avx512vbmi2intrin.h +357 -0
  57. package/framework/tools/x64/lib/clang/17/include/avx512vbmiintrin.h +105 -0
  58. package/framework/tools/x64/lib/clang/17/include/avx512vbmivlintrin.h +188 -0
  59. package/framework/tools/x64/lib/clang/17/include/avx512vlbf16intrin.h +515 -0
  60. package/framework/tools/x64/lib/clang/17/include/avx512vlbitalgintrin.h +145 -0
  61. package/framework/tools/x64/lib/clang/17/include/avx512vlbwintrin.h +3161 -0
  62. package/framework/tools/x64/lib/clang/17/include/avx512vlcdintrin.h +225 -0
  63. package/framework/tools/x64/lib/clang/17/include/avx512vldqintrin.h +1167 -0
  64. package/framework/tools/x64/lib/clang/17/include/avx512vlfp16intrin.h +2071 -0
  65. package/framework/tools/x64/lib/clang/17/include/avx512vlintrin.h +8431 -0
  66. package/framework/tools/x64/lib/clang/17/include/avx512vlvbmi2intrin.h +689 -0
  67. package/framework/tools/x64/lib/clang/17/include/avx512vlvnniintrin.h +304 -0
  68. package/framework/tools/x64/lib/clang/17/include/avx512vlvp2intersectintrin.h +121 -0
  69. package/framework/tools/x64/lib/clang/17/include/avx512vnniintrin.h +115 -0
  70. package/framework/tools/x64/lib/clang/17/include/avx512vp2intersectintrin.h +77 -0
  71. package/framework/tools/x64/lib/clang/17/include/avx512vpopcntdqintrin.h +54 -0
  72. package/framework/tools/x64/lib/clang/17/include/avx512vpopcntdqvlintrin.h +91 -0
  73. package/framework/tools/x64/lib/clang/17/include/avxifmaintrin.h +177 -0
  74. package/framework/tools/x64/lib/clang/17/include/avxintrin.h +5108 -0
  75. package/framework/tools/x64/lib/clang/17/include/avxneconvertintrin.h +484 -0
  76. package/framework/tools/x64/lib/clang/17/include/avxvnniint16intrin.h +473 -0
  77. package/framework/tools/x64/lib/clang/17/include/avxvnniint8intrin.h +471 -0
  78. package/framework/tools/x64/lib/clang/17/include/avxvnniintrin.h +225 -0
  79. package/framework/tools/x64/lib/clang/17/include/bmi2intrin.h +255 -0
  80. package/framework/tools/x64/lib/clang/17/include/bmiintrin.h +431 -0
  81. package/framework/tools/x64/lib/clang/17/include/builtins.h +16 -0
  82. package/framework/tools/x64/lib/clang/17/include/cet.h +66 -0
  83. package/framework/tools/x64/lib/clang/17/include/cetintrin.h +115 -0
  84. package/framework/tools/x64/lib/clang/17/include/cldemoteintrin.h +36 -0
  85. package/framework/tools/x64/lib/clang/17/include/clflushoptintrin.h +36 -0
  86. package/framework/tools/x64/lib/clang/17/include/clwbintrin.h +38 -0
  87. package/framework/tools/x64/lib/clang/17/include/clzerointrin.h +38 -0
  88. package/framework/tools/x64/lib/clang/17/include/cmpccxaddintrin.h +70 -0
  89. package/framework/tools/x64/lib/clang/17/include/cpuid.h +331 -0
  90. package/framework/tools/x64/lib/clang/17/include/crc32intrin.h +100 -0
  91. package/framework/tools/x64/lib/clang/17/include/cuda_wrappers/algorithm +116 -0
  92. package/framework/tools/x64/lib/clang/17/include/cuda_wrappers/bits/basic_string.h +9 -0
  93. package/framework/tools/x64/lib/clang/17/include/cuda_wrappers/bits/basic_string.tcc +9 -0
  94. package/framework/tools/x64/lib/clang/17/include/cuda_wrappers/bits/shared_ptr_base.h +9 -0
  95. package/framework/tools/x64/lib/clang/17/include/cuda_wrappers/cmath +90 -0
  96. package/framework/tools/x64/lib/clang/17/include/cuda_wrappers/complex +90 -0
  97. package/framework/tools/x64/lib/clang/17/include/cuda_wrappers/new +106 -0
  98. package/framework/tools/x64/lib/clang/17/include/emmintrin.h +4775 -0
  99. package/framework/tools/x64/lib/clang/17/include/enqcmdintrin.h +63 -0
  100. package/framework/tools/x64/lib/clang/17/include/f16cintrin.h +162 -0
  101. package/framework/tools/x64/lib/clang/17/include/float.h +168 -0
  102. package/framework/tools/x64/lib/clang/17/include/fma4intrin.h +218 -0
  103. package/framework/tools/x64/lib/clang/17/include/fmaintrin.h +780 -0
  104. package/framework/tools/x64/lib/clang/17/include/fxsrintrin.h +91 -0
  105. package/framework/tools/x64/lib/clang/17/include/gfniintrin.h +194 -0
  106. package/framework/tools/x64/lib/clang/17/include/hexagon_circ_brev_intrinsics.h +298 -0
  107. package/framework/tools/x64/lib/clang/17/include/hexagon_protos.h +8439 -0
  108. package/framework/tools/x64/lib/clang/17/include/hexagon_types.h +2621 -0
  109. package/framework/tools/x64/lib/clang/17/include/hresetintrin.h +49 -0
  110. package/framework/tools/x64/lib/clang/17/include/htmintrin.h +212 -0
  111. package/framework/tools/x64/lib/clang/17/include/htmxlintrin.h +345 -0
  112. package/framework/tools/x64/lib/clang/17/include/hvx_hexagon_protos.h +5183 -0
  113. package/framework/tools/x64/lib/clang/17/include/ia32intrin.h +441 -0
  114. package/framework/tools/x64/lib/clang/17/include/immintrin.h +758 -0
  115. package/framework/tools/x64/lib/clang/17/include/intrin.h +620 -0
  116. package/framework/tools/x64/lib/clang/17/include/inttypes.h +97 -0
  117. package/framework/tools/x64/lib/clang/17/include/invpcidintrin.h +23 -0
  118. package/framework/tools/x64/lib/clang/17/include/iso646.h +27 -0
  119. package/framework/tools/x64/lib/clang/17/include/keylockerintrin.h +530 -0
  120. package/framework/tools/x64/lib/clang/17/include/larchintrin.h +234 -0
  121. package/framework/tools/x64/lib/clang/17/include/limits.h +127 -0
  122. package/framework/tools/x64/lib/clang/17/include/llvm_libc_wrappers/ctype.h +85 -0
  123. package/framework/tools/x64/lib/clang/17/include/llvm_libc_wrappers/inttypes.h +34 -0
  124. package/framework/tools/x64/lib/clang/17/include/llvm_libc_wrappers/stdio.h +34 -0
  125. package/framework/tools/x64/lib/clang/17/include/llvm_libc_wrappers/stdlib.h +42 -0
  126. package/framework/tools/x64/lib/clang/17/include/llvm_libc_wrappers/string.h +37 -0
  127. package/framework/tools/x64/lib/clang/17/include/lwpintrin.h +136 -0
  128. package/framework/tools/x64/lib/clang/17/include/lzcntintrin.h +104 -0
  129. package/framework/tools/x64/lib/clang/17/include/mm3dnow.h +157 -0
  130. package/framework/tools/x64/lib/clang/17/include/mm_malloc.h +67 -0
  131. package/framework/tools/x64/lib/clang/17/include/mmintrin.h +1562 -0
  132. package/framework/tools/x64/lib/clang/17/include/module.modulemap +164 -0
  133. package/framework/tools/x64/lib/clang/17/include/movdirintrin.h +49 -0
  134. package/framework/tools/x64/lib/clang/17/include/msa.h +573 -0
  135. package/framework/tools/x64/lib/clang/17/include/mwaitxintrin.h +62 -0
  136. package/framework/tools/x64/lib/clang/17/include/nmmintrin.h +20 -0
  137. package/framework/tools/x64/lib/clang/17/include/opencl-c-base.h +820 -0
  138. package/framework/tools/x64/lib/clang/17/include/opencl-c.h +18356 -0
  139. package/framework/tools/x64/lib/clang/17/include/openmp_wrappers/__clang_openmp_device_functions.h +105 -0
  140. package/framework/tools/x64/lib/clang/17/include/openmp_wrappers/cmath +132 -0
  141. package/framework/tools/x64/lib/clang/17/include/openmp_wrappers/complex +55 -0
  142. package/framework/tools/x64/lib/clang/17/include/openmp_wrappers/complex.h +35 -0
  143. package/framework/tools/x64/lib/clang/17/include/openmp_wrappers/complex_cmath.h +388 -0
  144. package/framework/tools/x64/lib/clang/17/include/openmp_wrappers/math.h +61 -0
  145. package/framework/tools/x64/lib/clang/17/include/openmp_wrappers/new +48 -0
  146. package/framework/tools/x64/lib/clang/17/include/pconfigintrin.h +40 -0
  147. package/framework/tools/x64/lib/clang/17/include/pkuintrin.h +34 -0
  148. package/framework/tools/x64/lib/clang/17/include/pmmintrin.h +300 -0
  149. package/framework/tools/x64/lib/clang/17/include/popcntintrin.h +59 -0
  150. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/bmi2intrin.h +134 -0
  151. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/bmiintrin.h +165 -0
  152. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/emmintrin.h +2269 -0
  153. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/immintrin.h +27 -0
  154. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/mm_malloc.h +45 -0
  155. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/mmintrin.h +1453 -0
  156. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/pmmintrin.h +145 -0
  157. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/smmintrin.h +663 -0
  158. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/tmmintrin.h +453 -0
  159. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/x86gprintrin.h +17 -0
  160. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/x86intrin.h +28 -0
  161. package/framework/tools/x64/lib/clang/17/include/ppc_wrappers/xmmintrin.h +1827 -0
  162. package/framework/tools/x64/lib/clang/17/include/prfchiintrin.h +61 -0
  163. package/framework/tools/x64/lib/clang/17/include/prfchwintrin.h +58 -0
  164. package/framework/tools/x64/lib/clang/17/include/ptwriteintrin.h +37 -0
  165. package/framework/tools/x64/lib/clang/17/include/raointintrin.h +203 -0
  166. package/framework/tools/x64/lib/clang/17/include/rdpruintrin.h +57 -0
  167. package/framework/tools/x64/lib/clang/17/include/rdseedintrin.h +105 -0
  168. package/framework/tools/x64/lib/clang/17/include/riscv_ntlh.h +28 -0
  169. package/framework/tools/x64/lib/clang/17/include/rtmintrin.h +45 -0
  170. package/framework/tools/x64/lib/clang/17/include/s390intrin.h +25 -0
  171. package/framework/tools/x64/lib/clang/17/include/serializeintrin.h +30 -0
  172. package/framework/tools/x64/lib/clang/17/include/sgxintrin.h +60 -0
  173. package/framework/tools/x64/lib/clang/17/include/sha512intrin.h +200 -0
  174. package/framework/tools/x64/lib/clang/17/include/shaintrin.h +189 -0
  175. package/framework/tools/x64/lib/clang/17/include/sifive_vector.h +16 -0
  176. package/framework/tools/x64/lib/clang/17/include/sm3intrin.h +238 -0
  177. package/framework/tools/x64/lib/clang/17/include/sm4intrin.h +269 -0
  178. package/framework/tools/x64/lib/clang/17/include/smmintrin.h +2328 -0
  179. package/framework/tools/x64/lib/clang/17/include/stdalign.h +26 -0
  180. package/framework/tools/x64/lib/clang/17/include/stdarg.h +51 -0
  181. package/framework/tools/x64/lib/clang/17/include/stdatomic.h +196 -0
  182. package/framework/tools/x64/lib/clang/17/include/stdbool.h +34 -0
  183. package/framework/tools/x64/lib/clang/17/include/stddef.h +133 -0
  184. package/framework/tools/x64/lib/clang/17/include/stdint.h +979 -0
  185. package/framework/tools/x64/lib/clang/17/include/stdnoreturn.h +29 -0
  186. package/framework/tools/x64/lib/clang/17/include/tbmintrin.h +140 -0
  187. package/framework/tools/x64/lib/clang/17/include/tgmath.h +1368 -0
  188. package/framework/tools/x64/lib/clang/17/include/tmmintrin.h +775 -0
  189. package/framework/tools/x64/lib/clang/17/include/tsxldtrkintrin.h +56 -0
  190. package/framework/tools/x64/lib/clang/17/include/uintrintrin.h +157 -0
  191. package/framework/tools/x64/lib/clang/17/include/unwind.h +332 -0
  192. package/framework/tools/x64/lib/clang/17/include/vadefs.h +51 -0
  193. package/framework/tools/x64/lib/clang/17/include/vaesintrin.h +85 -0
  194. package/framework/tools/x64/lib/clang/17/include/varargs.h +12 -0
  195. package/framework/tools/x64/lib/clang/17/include/vecintrin.h +11127 -0
  196. package/framework/tools/x64/lib/clang/17/include/velintrin.h +71 -0
  197. package/framework/tools/x64/lib/clang/17/include/velintrin_approx.h +120 -0
  198. package/framework/tools/x64/lib/clang/17/include/velintrin_gen.h +1257 -0
  199. package/framework/tools/x64/lib/clang/17/include/vpclmulqdqintrin.h +30 -0
  200. package/framework/tools/x64/lib/clang/17/include/waitpkgintrin.h +42 -0
  201. package/framework/tools/x64/lib/clang/17/include/wasm_simd128.h +1997 -0
  202. package/framework/tools/x64/lib/clang/17/include/wbnoinvdintrin.h +24 -0
  203. package/framework/tools/x64/lib/clang/17/include/wmmintrin.h +23 -0
  204. package/framework/tools/x64/lib/clang/17/include/x86gprintrin.h +65 -0
  205. package/framework/tools/x64/lib/clang/17/include/x86intrin.h +67 -0
  206. package/framework/tools/x64/lib/clang/17/include/xmmintrin.h +3017 -0
  207. package/framework/tools/x64/lib/clang/17/include/xopintrin.h +770 -0
  208. package/framework/tools/x64/lib/clang/17/include/xsavecintrin.h +84 -0
  209. package/framework/tools/x64/lib/clang/17/include/xsaveintrin.h +63 -0
  210. package/framework/tools/x64/lib/clang/17/include/xsaveoptintrin.h +34 -0
  211. package/framework/tools/x64/lib/clang/17/include/xsavesintrin.h +44 -0
  212. package/framework/tools/x64/lib/clang/17/include/xtestintrin.h +27 -0
  213. package/framework/tools/x64/metadata-generator +4 -0
  214. package/framework/tools/x64/ns-bundle +0 -0
  215. package/framework/tools/x64/ns-metadata-filter +0 -0
  216. package/framework/typings/c!EGL.d.ts +431 -0
  217. package/framework/typings/c!GLES.d.ts +5002 -0
  218. package/framework/typings/c!GLib.d.ts +14488 -0
  219. package/framework/typings/c!Gtk.d.ts +17630 -0
  220. package/framework/typings/c!X11.d.ts +7054 -0
  221. package/framework/typings/c!_Builtin_intrinsics.d.ts +106 -0
  222. package/framework/typings/c!_Builtin_stddef_max_align_t.d.ts +6 -0
  223. package/framework/typings/c!cairo.d.ts +1248 -0
  224. package/framework/typings/c!fontconfig.d.ts +819 -0
  225. package/framework/typings/c!freetype.d.ts +1068 -0
  226. package/framework/typings/c!gdk_pixbuf.d.ts +326 -0
  227. package/framework/typings/c!graphene.d.ts +320 -0
  228. package/framework/typings/c!harfbuzz.d.ts +1292 -0
  229. package/framework/typings/c!icu.d.ts +3330 -0
  230. package/framework/typings/c!libc.d.ts +11639 -0
  231. package/framework/typings/c!libxml2.d.ts +7029 -0
  232. package/framework/typings/c!pango.d.ts +2225 -0
  233. package/framework/typings/c!uuid.d.ts +68 -0
  234. package/framework/typings/c!zlib.d.ts +276 -0
  235. package/framework/typings/index.d.ts +10 -0
  236. package/framework/typings/linux-runtime.d.ts +90 -0
  237. package/package.json +9 -4
  238. package/README.md +0 -3
@@ -0,0 +1,234 @@
1
+ /*===------------ larchintrin.h - LoongArch intrinsics ---------------------===
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
+
10
+ #ifndef _LOONGARCH_BASE_INTRIN_H
11
+ #define _LOONGARCH_BASE_INTRIN_H
12
+
13
+ #ifdef __cplusplus
14
+ extern "C" {
15
+ #endif
16
+
17
+ typedef struct rdtime {
18
+ unsigned int value;
19
+ unsigned int timeid;
20
+ } __rdtime_t;
21
+
22
+ #if __loongarch_grlen == 64
23
+ typedef struct drdtime {
24
+ unsigned long dvalue;
25
+ unsigned long dtimeid;
26
+ } __drdtime_t;
27
+
28
+ extern __inline __drdtime_t
29
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
30
+ __rdtime_d(void) {
31
+ __drdtime_t __drdtime;
32
+ __asm__ volatile(
33
+ "rdtime.d %[val], %[tid]\n\t"
34
+ : [val] "=&r"(__drdtime.dvalue), [tid] "=&r"(__drdtime.dtimeid));
35
+ return __drdtime;
36
+ }
37
+ #endif
38
+
39
+ extern __inline __rdtime_t
40
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
41
+ __rdtimeh_w(void) {
42
+ __rdtime_t __rdtime;
43
+ __asm__ volatile("rdtimeh.w %[val], %[tid]\n\t"
44
+ : [val] "=&r"(__rdtime.value), [tid] "=&r"(__rdtime.timeid));
45
+ return __rdtime;
46
+ }
47
+
48
+ extern __inline __rdtime_t
49
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
50
+ __rdtimel_w(void) {
51
+ __rdtime_t __rdtime;
52
+ __asm__ volatile("rdtimel.w %[val], %[tid]\n\t"
53
+ : [val] "=&r"(__rdtime.value), [tid] "=&r"(__rdtime.timeid));
54
+ return __rdtime;
55
+ }
56
+
57
+ #if __loongarch_grlen == 64
58
+ extern __inline int
59
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
60
+ __crc_w_b_w(char _1, int _2) {
61
+ return (int)__builtin_loongarch_crc_w_b_w((char)_1, (int)_2);
62
+ }
63
+
64
+ extern __inline int
65
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
66
+ __crc_w_h_w(short _1, int _2) {
67
+ return (int)__builtin_loongarch_crc_w_h_w((short)_1, (int)_2);
68
+ }
69
+
70
+ extern __inline int
71
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
72
+ __crc_w_w_w(int _1, int _2) {
73
+ return (int)__builtin_loongarch_crc_w_w_w((int)_1, (int)_2);
74
+ }
75
+
76
+ extern __inline int
77
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
78
+ __crc_w_d_w(long int _1, int _2) {
79
+ return (int)__builtin_loongarch_crc_w_d_w((long int)_1, (int)_2);
80
+ }
81
+
82
+ extern __inline int
83
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
84
+ __crcc_w_b_w(char _1, int _2) {
85
+ return (int)__builtin_loongarch_crcc_w_b_w((char)_1, (int)_2);
86
+ }
87
+
88
+ extern __inline int
89
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
90
+ __crcc_w_h_w(short _1, int _2) {
91
+ return (int)__builtin_loongarch_crcc_w_h_w((short)_1, (int)_2);
92
+ }
93
+
94
+ extern __inline int
95
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
96
+ __crcc_w_w_w(int _1, int _2) {
97
+ return (int)__builtin_loongarch_crcc_w_w_w((int)_1, (int)_2);
98
+ }
99
+
100
+ extern __inline int
101
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
102
+ __crcc_w_d_w(long int _1, int _2) {
103
+ return (int)__builtin_loongarch_crcc_w_d_w((long int)_1, (int)_2);
104
+ }
105
+ #endif
106
+
107
+ #define __break(/*ui15*/ _1) __builtin_loongarch_break((_1))
108
+
109
+ #if __loongarch_grlen == 32
110
+ #define __cacop_w(/*uimm5*/ _1, /*unsigned int*/ _2, /*simm12*/ _3) \
111
+ ((void)__builtin_loongarch_cacop_w((_1), (unsigned int)(_2), (_3)))
112
+ #endif
113
+
114
+ #if __loongarch_grlen == 64
115
+ #define __cacop_d(/*uimm5*/ _1, /*unsigned long int*/ _2, /*simm12*/ _3) \
116
+ ((void)__builtin_loongarch_cacop_d((_1), (unsigned long int)(_2), (_3)))
117
+ #endif
118
+
119
+ #define __dbar(/*ui15*/ _1) __builtin_loongarch_dbar((_1))
120
+
121
+ #define __ibar(/*ui15*/ _1) __builtin_loongarch_ibar((_1))
122
+
123
+ #define __movfcsr2gr(/*ui5*/ _1) __builtin_loongarch_movfcsr2gr((_1));
124
+
125
+ #define __movgr2fcsr(/*ui5*/ _1, _2) \
126
+ __builtin_loongarch_movgr2fcsr((_1), (unsigned int)_2);
127
+
128
+ #define __syscall(/*ui15*/ _1) __builtin_loongarch_syscall((_1))
129
+
130
+ #define __csrrd_w(/*ui14*/ _1) ((unsigned int)__builtin_loongarch_csrrd_w((_1)))
131
+
132
+ #define __csrwr_w(/*unsigned int*/ _1, /*ui14*/ _2) \
133
+ ((unsigned int)__builtin_loongarch_csrwr_w((unsigned int)(_1), (_2)))
134
+
135
+ #define __csrxchg_w(/*unsigned int*/ _1, /*unsigned int*/ _2, /*ui14*/ _3) \
136
+ ((unsigned int)__builtin_loongarch_csrxchg_w((unsigned int)(_1), \
137
+ (unsigned int)(_2), (_3)))
138
+
139
+ #if __loongarch_grlen == 64
140
+ #define __csrrd_d(/*ui14*/ _1) \
141
+ ((unsigned long int)__builtin_loongarch_csrrd_d((_1)))
142
+
143
+ #define __csrwr_d(/*unsigned long int*/ _1, /*ui14*/ _2) \
144
+ ((unsigned long int)__builtin_loongarch_csrwr_d((unsigned long int)(_1), \
145
+ (_2)))
146
+
147
+ #define __csrxchg_d(/*unsigned long int*/ _1, /*unsigned long int*/ _2, \
148
+ /*ui14*/ _3) \
149
+ ((unsigned long int)__builtin_loongarch_csrxchg_d( \
150
+ (unsigned long int)(_1), (unsigned long int)(_2), (_3)))
151
+ #endif
152
+
153
+ extern __inline unsigned char
154
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
155
+ __iocsrrd_b(unsigned int _1) {
156
+ return (unsigned char)__builtin_loongarch_iocsrrd_b((unsigned int)_1);
157
+ }
158
+
159
+ extern __inline unsigned char
160
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
161
+ __iocsrrd_h(unsigned int _1) {
162
+ return (unsigned short)__builtin_loongarch_iocsrrd_h((unsigned int)_1);
163
+ }
164
+
165
+ extern __inline unsigned int
166
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
167
+ __iocsrrd_w(unsigned int _1) {
168
+ return (unsigned int)__builtin_loongarch_iocsrrd_w((unsigned int)_1);
169
+ }
170
+
171
+ #if __loongarch_grlen == 64
172
+ extern __inline unsigned long int
173
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
174
+ __iocsrrd_d(unsigned int _1) {
175
+ return (unsigned long int)__builtin_loongarch_iocsrrd_d((unsigned int)_1);
176
+ }
177
+ #endif
178
+
179
+ extern __inline void
180
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
181
+ __iocsrwr_b(unsigned char _1, unsigned int _2) {
182
+ __builtin_loongarch_iocsrwr_b((unsigned char)_1, (unsigned int)_2);
183
+ }
184
+
185
+ extern __inline void
186
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
187
+ __iocsrwr_h(unsigned short _1, unsigned int _2) {
188
+ __builtin_loongarch_iocsrwr_h((unsigned short)_1, (unsigned int)_2);
189
+ }
190
+
191
+ extern __inline void
192
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
193
+ __iocsrwr_w(unsigned int _1, unsigned int _2) {
194
+ __builtin_loongarch_iocsrwr_w((unsigned int)_1, (unsigned int)_2);
195
+ }
196
+
197
+ extern __inline unsigned int
198
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
199
+ __cpucfg(unsigned int _1) {
200
+ return (unsigned int)__builtin_loongarch_cpucfg((unsigned int)_1);
201
+ }
202
+
203
+ #if __loongarch_grlen == 64
204
+ extern __inline void
205
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
206
+ __iocsrwr_d(unsigned long int _1, unsigned int _2) {
207
+ __builtin_loongarch_iocsrwr_d((unsigned long int)_1, (unsigned int)_2);
208
+ }
209
+
210
+ extern __inline void
211
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
212
+ __asrtgt_d(long int _1, long int _2) {
213
+ __builtin_loongarch_asrtgt_d((long int)_1, (long int)_2);
214
+ }
215
+
216
+ extern __inline void
217
+ __attribute__((__gnu_inline__, __always_inline__, __artificial__))
218
+ __asrtle_d(long int _1, long int _2) {
219
+ __builtin_loongarch_asrtle_d((long int)_1, (long int)_2);
220
+ }
221
+ #endif
222
+
223
+ #if __loongarch_grlen == 64
224
+ #define __lddir_d(/*long int*/ _1, /*ui5*/ _2) \
225
+ ((long int)__builtin_loongarch_lddir_d((long int)(_1), (_2)))
226
+
227
+ #define __ldpte_d(/*long int*/ _1, /*ui5*/ _2) \
228
+ ((void)__builtin_loongarch_ldpte_d((long int)(_1), (_2)))
229
+ #endif
230
+
231
+ #ifdef __cplusplus
232
+ }
233
+ #endif
234
+ #endif /* _LOONGARCH_BASE_INTRIN_H */
@@ -0,0 +1,127 @@
1
+ /*===---- limits.h - Standard header for integer sizes --------------------===*\
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_LIMITS_H
10
+ #define __CLANG_LIMITS_H
11
+
12
+ /* The system's limits.h may, in turn, try to #include_next GCC's limits.h.
13
+ Avert this #include_next madness. */
14
+ #if defined __GNUC__ && !defined _GCC_LIMITS_H_
15
+ #define _GCC_LIMITS_H_
16
+ #endif
17
+
18
+ /* System headers include a number of constants from POSIX in <limits.h>.
19
+ Include it if we're hosted. */
20
+ #if __STDC_HOSTED__ && __has_include_next(<limits.h>)
21
+ #include_next <limits.h>
22
+ #endif
23
+
24
+ /* Many system headers try to "help us out" by defining these. No really, we
25
+ know how big each datatype is. */
26
+ #undef SCHAR_MIN
27
+ #undef SCHAR_MAX
28
+ #undef UCHAR_MAX
29
+ #undef SHRT_MIN
30
+ #undef SHRT_MAX
31
+ #undef USHRT_MAX
32
+ #undef INT_MIN
33
+ #undef INT_MAX
34
+ #undef UINT_MAX
35
+ #undef LONG_MIN
36
+ #undef LONG_MAX
37
+ #undef ULONG_MAX
38
+
39
+ #undef CHAR_BIT
40
+ #undef CHAR_MIN
41
+ #undef CHAR_MAX
42
+
43
+ /* C90/99 5.2.4.2.1 */
44
+ #define SCHAR_MAX __SCHAR_MAX__
45
+ #define SHRT_MAX __SHRT_MAX__
46
+ #define INT_MAX __INT_MAX__
47
+ #define LONG_MAX __LONG_MAX__
48
+
49
+ #define SCHAR_MIN (-__SCHAR_MAX__-1)
50
+ #define SHRT_MIN (-__SHRT_MAX__ -1)
51
+ #define INT_MIN (-__INT_MAX__ -1)
52
+ #define LONG_MIN (-__LONG_MAX__ -1L)
53
+
54
+ #define UCHAR_MAX (__SCHAR_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
60
+ #define UINT_MAX (__INT_MAX__ *2U +1U)
61
+ #define ULONG_MAX (__LONG_MAX__ *2UL+1UL)
62
+
63
+ #ifndef MB_LEN_MAX
64
+ #define MB_LEN_MAX 1
65
+ #endif
66
+
67
+ #define CHAR_BIT __CHAR_BIT__
68
+
69
+ /* C2x 5.2.4.2.1 */
70
+ /* FIXME: This is using the placeholder dates Clang produces for these macros
71
+ in C2x mode; switch to the correct values once they've been published. */
72
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L
73
+ #define BOOL_WIDTH __BOOL_WIDTH__
74
+ #define CHAR_WIDTH CHAR_BIT
75
+ #define SCHAR_WIDTH CHAR_BIT
76
+ #define UCHAR_WIDTH CHAR_BIT
77
+ #define USHRT_WIDTH __SHRT_WIDTH__
78
+ #define SHRT_WIDTH __SHRT_WIDTH__
79
+ #define UINT_WIDTH __INT_WIDTH__
80
+ #define INT_WIDTH __INT_WIDTH__
81
+ #define ULONG_WIDTH __LONG_WIDTH__
82
+ #define LONG_WIDTH __LONG_WIDTH__
83
+ #define ULLONG_WIDTH __LLONG_WIDTH__
84
+ #define LLONG_WIDTH __LLONG_WIDTH__
85
+
86
+ #define BITINT_MAXWIDTH __BITINT_MAXWIDTH__
87
+ #endif
88
+
89
+ #ifdef __CHAR_UNSIGNED__ /* -funsigned-char */
90
+ #define CHAR_MIN 0
91
+ #define CHAR_MAX UCHAR_MAX
92
+ #else
93
+ #define CHAR_MIN SCHAR_MIN
94
+ #define CHAR_MAX __SCHAR_MAX__
95
+ #endif
96
+
97
+ /* C99 5.2.4.2.1: Added long long.
98
+ C++11 18.3.3.2: same contents as the Standard C Library header <limits.h>.
99
+ */
100
+ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
101
+ (defined(__cplusplus) && __cplusplus >= 201103L)
102
+
103
+ #undef LLONG_MIN
104
+ #undef LLONG_MAX
105
+ #undef ULLONG_MAX
106
+
107
+ #define LLONG_MAX __LONG_LONG_MAX__
108
+ #define LLONG_MIN (-__LONG_LONG_MAX__-1LL)
109
+ #define ULLONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
110
+ #endif
111
+
112
+ /* LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX are a GNU extension. It's too bad
113
+ that we don't have something like #pragma poison that could be used to
114
+ deprecate a macro - the code should just use LLONG_MAX and friends.
115
+ */
116
+ #if defined(__GNU_LIBRARY__) ? defined(__USE_GNU) : !defined(__STRICT_ANSI__)
117
+
118
+ #undef LONG_LONG_MIN
119
+ #undef LONG_LONG_MAX
120
+ #undef ULONG_LONG_MAX
121
+
122
+ #define LONG_LONG_MAX __LONG_LONG_MAX__
123
+ #define LONG_LONG_MIN (-__LONG_LONG_MAX__-1LL)
124
+ #define ULONG_LONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
125
+ #endif
126
+
127
+ #endif /* __CLANG_LIMITS_H */
@@ -0,0 +1,85 @@
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
+ #include_next <ctype.h>
17
+
18
+ #if __has_include(<llvm-libc-decls/ctype.h>)
19
+
20
+ #if defined(__HIP__) || defined(__CUDA__)
21
+ #define __LIBC_ATTRS __attribute__((device))
22
+ #endif
23
+
24
+ // The GNU headers like to provide these as macros, we need to undefine them so
25
+ // they do not conflict with the following definitions for the GPU.
26
+
27
+ #pragma push_macro("isalnum")
28
+ #pragma push_macro("isalpha")
29
+ #pragma push_macro("isblank")
30
+ #pragma push_macro("iscntrl")
31
+ #pragma push_macro("isdigit")
32
+ #pragma push_macro("isgraph")
33
+ #pragma push_macro("islower")
34
+ #pragma push_macro("isprint")
35
+ #pragma push_macro("ispunct")
36
+ #pragma push_macro("isspace")
37
+ #pragma push_macro("isupper")
38
+ #pragma push_macro("isxdigit")
39
+ #pragma push_macro("tolower")
40
+ #pragma push_macro("toupper")
41
+
42
+ #undef isalnum
43
+ #undef isalpha
44
+ #undef iscntrl
45
+ #undef isdigit
46
+ #undef islower
47
+ #undef isgraph
48
+ #undef isprint
49
+ #undef ispunct
50
+ #undef isspace
51
+ #undef isupper
52
+ #undef isblank
53
+ #undef isxdigit
54
+ #undef tolower
55
+ #undef toupper
56
+
57
+ #pragma omp begin declare target
58
+
59
+ #include <llvm-libc-decls/ctype.h>
60
+
61
+ #pragma omp end declare target
62
+
63
+ // Restore the original macros when compiling on the host.
64
+ #if !defined(__NVPTX__) && !defined(__AMDGPU__)
65
+ #pragma pop_macro("isalnum")
66
+ #pragma pop_macro("isalpha")
67
+ #pragma pop_macro("isblank")
68
+ #pragma pop_macro("iscntrl")
69
+ #pragma pop_macro("isdigit")
70
+ #pragma pop_macro("isgraph")
71
+ #pragma pop_macro("islower")
72
+ #pragma pop_macro("isprint")
73
+ #pragma pop_macro("ispunct")
74
+ #pragma pop_macro("isspace")
75
+ #pragma pop_macro("isupper")
76
+ #pragma pop_macro("isxdigit")
77
+ #pragma pop_macro("tolower")
78
+ #pragma pop_macro("toupper")
79
+ #endif
80
+
81
+ #undef __LIBC_ATTRS
82
+
83
+ #endif
84
+
85
+ #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,34 @@
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
+ #ifndef __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
10
+ #define __CLANG_LLVM_LIBC_WRAPPERS_STDIO_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 <stdio.h>
17
+
18
+ #if __has_include(<llvm-libc-decls/stdio.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/stdio.h>
27
+
28
+ #pragma omp end declare target
29
+
30
+ #undef __LIBC_ATTRS
31
+
32
+ #endif
33
+
34
+ #endif // __CLANG_LLVM_LIBC_WRAPPERS_STDIO_H__
@@ -0,0 +1,42 @@
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 this type so we forward declare it.
27
+ typedef void (*__atexithandler_t)(void);
28
+
29
+ // Enforce ABI compatibility with the structs used by the LLVM C library.
30
+ _Static_assert(__builtin_offsetof(div_t, quot) == 0, "ABI mismatch!");
31
+ _Static_assert(__builtin_offsetof(ldiv_t, quot) == 0, "ABI mismatch!");
32
+ _Static_assert(__builtin_offsetof(lldiv_t, quot) == 0, "ABI mismatch!");
33
+
34
+ #include <llvm-libc-decls/stdlib.h>
35
+
36
+ #pragma omp end declare target
37
+
38
+ #undef __LIBC_ATTRS
39
+
40
+ #endif
41
+
42
+ #endif // __CLANG_LLVM_LIBC_WRAPPERS_STDLIB_H__
@@ -0,0 +1,37 @@
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
+ // FIXME: The GNU headers provide C++ standard compliant headers when in C++
17
+ // mode and the LLVM libc does not. We cannot enable memchr, strchr, strchrnul,
18
+ // strpbrk, strrchr, strstr, or strcasestr until this is addressed.
19
+ #include_next <string.h>
20
+
21
+ #if __has_include(<llvm-libc-decls/string.h>)
22
+
23
+ #if defined(__HIP__) || defined(__CUDA__)
24
+ #define __LIBC_ATTRS __attribute__((device))
25
+ #endif
26
+
27
+ #pragma omp begin declare target
28
+
29
+ #include <llvm-libc-decls/string.h>
30
+
31
+ #pragma omp end declare target
32
+
33
+ #undef __LIBC_ATTRS
34
+
35
+ #endif
36
+
37
+ #endif // __CLANG_LLVM_LIBC_WRAPPERS_STRING_H__