llvm-runtime-resources-darwin 0.0.0 → 23.1.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 (372) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +33 -0
  3. package/include/__clang_cuda_builtin_vars.h +121 -0
  4. package/include/__clang_cuda_cmath.h +512 -0
  5. package/include/__clang_cuda_complex_builtins.h +236 -0
  6. package/include/__clang_cuda_device_functions.h +1572 -0
  7. package/include/__clang_cuda_intrinsics.h +975 -0
  8. package/include/__clang_cuda_libdevice_declares.h +468 -0
  9. package/include/__clang_cuda_math.h +353 -0
  10. package/include/__clang_cuda_math_forward_declares.h +289 -0
  11. package/include/__clang_cuda_runtime_wrapper.h +526 -0
  12. package/include/__clang_cuda_texture_intrinsics.h +1177 -0
  13. package/include/__clang_gpu_builtin_vars.h +71 -0
  14. package/include/__clang_gpu_device_functions.h +411 -0
  15. package/include/__clang_gpu_intrinsics.h +242 -0
  16. package/include/__clang_hip_cmath.h +848 -0
  17. package/include/__clang_hip_libdevice_declares.h +238 -0
  18. package/include/__clang_hip_math.h +1405 -0
  19. package/include/__clang_hip_runtime_wrapper.h +170 -0
  20. package/include/__clang_hip_stdlib.h +43 -0
  21. package/include/__clang_spirv_builtins.h +217 -0
  22. package/include/__clang_spirv_libdevice_declares.h +170 -0
  23. package/include/__clang_spirv_math.h +719 -0
  24. package/include/__float_float.h +176 -0
  25. package/include/__float_header_macro.h +12 -0
  26. package/include/__float_infinity_nan.h +20 -0
  27. package/include/__stdarg___gnuc_va_list.h +13 -0
  28. package/include/__stdarg___va_copy.h +12 -0
  29. package/include/__stdarg_header_macro.h +12 -0
  30. package/include/__stdarg_va_arg.h +22 -0
  31. package/include/__stdarg_va_copy.h +12 -0
  32. package/include/__stdarg_va_list.h +13 -0
  33. package/include/__stddef_header_macro.h +12 -0
  34. package/include/__stddef_max_align_t.h +27 -0
  35. package/include/__stddef_null.h +29 -0
  36. package/include/__stddef_nullptr_t.h +29 -0
  37. package/include/__stddef_offsetof.h +17 -0
  38. package/include/__stddef_ptrdiff_t.h +20 -0
  39. package/include/__stddef_rsize_t.h +20 -0
  40. package/include/__stddef_size_t.h +20 -0
  41. package/include/__stddef_unreachable.h +21 -0
  42. package/include/__stddef_wchar_t.h +28 -0
  43. package/include/__stddef_wint_t.h +15 -0
  44. package/include/__wmmintrin_aes.h +140 -0
  45. package/include/__wmmintrin_pclmul.h +48 -0
  46. package/include/adcintrin.h +165 -0
  47. package/include/adxintrin.h +107 -0
  48. package/include/altivec.h +19434 -0
  49. package/include/amdgpuintrin.h +164 -0
  50. package/include/amdhsa_abi.h +83 -0
  51. package/include/ammintrin.h +183 -0
  52. package/include/amo.h +220 -0
  53. package/include/amxavx512intrin.h +596 -0
  54. package/include/amxcomplexintrin.h +167 -0
  55. package/include/amxfp16intrin.h +93 -0
  56. package/include/amxfp8intrin.h +230 -0
  57. package/include/amxintrin.h +492 -0
  58. package/include/amxmovrsintrin.h +48 -0
  59. package/include/andes_vector.h +21 -0
  60. package/include/arm64_neon.h +21 -0
  61. package/include/arm64intr.h +45 -0
  62. package/include/arm_acle.h +866 -0
  63. package/include/arm_bf16.h +20 -0
  64. package/include/arm_cde.h +410 -0
  65. package/include/arm_cmse.h +217 -0
  66. package/include/arm_fp16.h +596 -0
  67. package/include/arm_mve.h +19187 -0
  68. package/include/arm_neon.h +74351 -0
  69. package/include/arm_neon_sve_bridge.h +182 -0
  70. package/include/arm_sme.h +3753 -0
  71. package/include/arm_sve.h +32698 -0
  72. package/include/arm_vector_types.h +432 -0
  73. package/include/armintr.h +31 -0
  74. package/include/avx10_2_512bf16intrin.h +568 -0
  75. package/include/avx10_2_512convertintrin.h +322 -0
  76. package/include/avx10_2_512minmaxintrin.h +127 -0
  77. package/include/avx10_2_512niintrin.h +314 -0
  78. package/include/avx10_2_512satcvtdsintrin.h +307 -0
  79. package/include/avx10_2_512satcvtintrin.h +301 -0
  80. package/include/avx10_2bf16intrin.h +1094 -0
  81. package/include/avx10_2convertintrin.h +3257 -0
  82. package/include/avx10_2copyintrin.h +66 -0
  83. package/include/avx10_2minmaxintrin.h +232 -0
  84. package/include/avx10_2niintrin.h +409 -0
  85. package/include/avx10_2satcvtdsintrin.h +376 -0
  86. package/include/avx10_2satcvtintrin.h +312 -0
  87. package/include/avx2intrin.h +5190 -0
  88. package/include/avx512bf16intrin.h +292 -0
  89. package/include/avx512bitalgintrin.h +75 -0
  90. package/include/avx512bmmintrin.h +174 -0
  91. package/include/avx512bmmvlintrin.h +245 -0
  92. package/include/avx512bwintrin.h +1885 -0
  93. package/include/avx512cdintrin.h +112 -0
  94. package/include/avx512dqintrin.h +1350 -0
  95. package/include/avx512fintrin.h +9351 -0
  96. package/include/avx512fp16intrin.h +3349 -0
  97. package/include/avx512ifmaintrin.h +68 -0
  98. package/include/avx512ifmavlintrin.h +138 -0
  99. package/include/avx512vbmi2intrin.h +364 -0
  100. package/include/avx512vbmiintrin.h +98 -0
  101. package/include/avx512vbmivlintrin.h +179 -0
  102. package/include/avx512vlbf16intrin.h +527 -0
  103. package/include/avx512vlbitalgintrin.h +135 -0
  104. package/include/avx512vlbwintrin.h +3052 -0
  105. package/include/avx512vlcdintrin.h +202 -0
  106. package/include/avx512vldqintrin.h +1156 -0
  107. package/include/avx512vlfp16intrin.h +2090 -0
  108. package/include/avx512vlintrin.h +8067 -0
  109. package/include/avx512vlvbmi2intrin.h +702 -0
  110. package/include/avx512vlvnniintrin.h +308 -0
  111. package/include/avx512vlvp2intersectintrin.h +123 -0
  112. package/include/avx512vnniintrin.h +113 -0
  113. package/include/avx512vp2intersectintrin.h +77 -0
  114. package/include/avx512vpopcntdqintrin.h +62 -0
  115. package/include/avx512vpopcntdqvlintrin.h +105 -0
  116. package/include/avxifmaintrin.h +193 -0
  117. package/include/avxintrin.h +5064 -0
  118. package/include/avxneconvertintrin.h +484 -0
  119. package/include/avxvnniint16intrin.h +451 -0
  120. package/include/avxvnniint8intrin.h +454 -0
  121. package/include/avxvnniintrin.h +238 -0
  122. package/include/bmi2intrin.h +253 -0
  123. package/include/bmiintrin.h +604 -0
  124. package/include/builtins.h +19 -0
  125. package/include/cet.h +66 -0
  126. package/include/cetintrin.h +115 -0
  127. package/include/cldemoteintrin.h +36 -0
  128. package/include/clflushoptintrin.h +36 -0
  129. package/include/clwbintrin.h +38 -0
  130. package/include/clzerointrin.h +38 -0
  131. package/include/cmpccxaddintrin.h +70 -0
  132. package/include/cpuid.h +451 -0
  133. package/include/crc32intrin.h +102 -0
  134. package/include/cuda_wrappers/__utility/declval.h +28 -0
  135. package/include/cuda_wrappers/algorithm +116 -0
  136. package/include/cuda_wrappers/bits/basic_string.h +9 -0
  137. package/include/cuda_wrappers/bits/basic_string.tcc +9 -0
  138. package/include/cuda_wrappers/bits/c++config.h +61 -0
  139. package/include/cuda_wrappers/bits/shared_ptr_base.h +9 -0
  140. package/include/cuda_wrappers/cmath +44 -0
  141. package/include/cuda_wrappers/complex +90 -0
  142. package/include/cuda_wrappers/new +108 -0
  143. package/include/emmintrin.h +4940 -0
  144. package/include/endian.h +91 -0
  145. package/include/enqcmdintrin.h +63 -0
  146. package/include/f16cintrin.h +176 -0
  147. package/include/float.h +48 -0
  148. package/include/fma4intrin.h +220 -0
  149. package/include/fmaintrin.h +826 -0
  150. package/include/fuzzer/FuzzedDataProvider.h +397 -0
  151. package/include/fxsrintrin.h +91 -0
  152. package/include/gfniintrin.h +238 -0
  153. package/include/gpuintrin.h +348 -0
  154. package/include/hexagon_circ_brev_intrinsics.h +298 -0
  155. package/include/hexagon_protos.h +8439 -0
  156. package/include/hexagon_types.h +2628 -0
  157. package/include/hlsl_alias_intrinsics_gen.inc +3869 -0
  158. package/include/hlsl_inline_intrinsics_gen.inc +546 -0
  159. package/include/hresetintrin.h +49 -0
  160. package/include/htmintrin.h +212 -0
  161. package/include/htmxlintrin.h +345 -0
  162. package/include/hvx_hexagon_protos.h +5421 -0
  163. package/include/ia32intrin.h +863 -0
  164. package/include/immintrin.h +597 -0
  165. package/include/intrin.h +501 -0
  166. package/include/intrin0.h +256 -0
  167. package/include/inttypes.h +101 -0
  168. package/include/invpcidintrin.h +23 -0
  169. package/include/iso646.h +31 -0
  170. package/include/keylockerintrin.h +518 -0
  171. package/include/larchintrin.h +262 -0
  172. package/include/lasxintrin.h +3999 -0
  173. package/include/limits.h +133 -0
  174. package/include/llvm_libc_wrappers/assert.h +32 -0
  175. package/include/llvm_libc_wrappers/ctype.h +29 -0
  176. package/include/llvm_libc_wrappers/inttypes.h +32 -0
  177. package/include/llvm_libc_wrappers/stdio.h +52 -0
  178. package/include/llvm_libc_wrappers/stdlib.h +32 -0
  179. package/include/llvm_libc_wrappers/string.h +29 -0
  180. package/include/llvm_libc_wrappers/time.h +28 -0
  181. package/include/llvm_offload_wrappers/__llvm_offload.h +31 -0
  182. package/include/llvm_offload_wrappers/__llvm_offload_device.h +10 -0
  183. package/include/llvm_offload_wrappers/__llvm_offload_host.h +15 -0
  184. package/include/lsxintrin.h +3752 -0
  185. package/include/lwpintrin.h +136 -0
  186. package/include/lzcntintrin.h +109 -0
  187. package/include/mm3dnow.h +22 -0
  188. package/include/mm_malloc.h +67 -0
  189. package/include/mmintrin.h +1541 -0
  190. package/include/module.modulemap +375 -0
  191. package/include/movdirintrin.h +49 -0
  192. package/include/movrs_avx10_2_512intrin.h +98 -0
  193. package/include/movrs_avx10_2intrin.h +174 -0
  194. package/include/movrsintrin.h +59 -0
  195. package/include/msa.h +573 -0
  196. package/include/mwaitxintrin.h +62 -0
  197. package/include/nmmintrin.h +20 -0
  198. package/include/nvptxintrin.h +208 -0
  199. package/include/opencl-c-base.h +765 -0
  200. package/include/opencl-c.h +18737 -0
  201. package/include/openmp_wrappers/__clang_openmp_device_functions.h +118 -0
  202. package/include/openmp_wrappers/cmath +132 -0
  203. package/include/openmp_wrappers/complex +61 -0
  204. package/include/openmp_wrappers/complex.h +41 -0
  205. package/include/openmp_wrappers/complex_cmath.h +393 -0
  206. package/include/openmp_wrappers/math.h +71 -0
  207. package/include/openmp_wrappers/new +48 -0
  208. package/include/pconfigintrin.h +40 -0
  209. package/include/pkuintrin.h +34 -0
  210. package/include/pmmintrin.h +302 -0
  211. package/include/popcntintrin.h +59 -0
  212. package/include/ppc_wrappers/bmi2intrin.h +134 -0
  213. package/include/ppc_wrappers/bmiintrin.h +165 -0
  214. package/include/ppc_wrappers/emmintrin.h +2269 -0
  215. package/include/ppc_wrappers/immintrin.h +27 -0
  216. package/include/ppc_wrappers/mm_malloc.h +45 -0
  217. package/include/ppc_wrappers/mmintrin.h +1453 -0
  218. package/include/ppc_wrappers/nmmintrin.h +26 -0
  219. package/include/ppc_wrappers/pmmintrin.h +145 -0
  220. package/include/ppc_wrappers/smmintrin.h +683 -0
  221. package/include/ppc_wrappers/tmmintrin.h +453 -0
  222. package/include/ppc_wrappers/x86gprintrin.h +17 -0
  223. package/include/ppc_wrappers/x86intrin.h +28 -0
  224. package/include/ppc_wrappers/xmmintrin.h +1827 -0
  225. package/include/prfchiintrin.h +61 -0
  226. package/include/prfchwintrin.h +57 -0
  227. package/include/profile/InstrProfData.inc +1063 -0
  228. package/include/profile/instr_prof_interface.h +88 -0
  229. package/include/ptrauth.h +485 -0
  230. package/include/ptwriteintrin.h +37 -0
  231. package/include/raointintrin.h +203 -0
  232. package/include/rdpruintrin.h +57 -0
  233. package/include/rdseedintrin.h +105 -0
  234. package/include/riscv_bitmanip.h +202 -0
  235. package/include/riscv_corev_alu.h +130 -0
  236. package/include/riscv_crypto.h +178 -0
  237. package/include/riscv_mips.h +36 -0
  238. package/include/riscv_nds.h +92 -0
  239. package/include/riscv_ntlh.h +28 -0
  240. package/include/riscv_packed_simd.h +644 -0
  241. package/include/riscv_vector.h +465 -0
  242. package/include/rtmintrin.h +45 -0
  243. package/include/s390intrin.h +25 -0
  244. package/include/sanitizer/allocator_interface.h +106 -0
  245. package/include/sanitizer/asan_interface.h +398 -0
  246. package/include/sanitizer/common_interface_defs.h +507 -0
  247. package/include/sanitizer/coverage_interface.h +36 -0
  248. package/include/sanitizer/dfsan_interface.h +220 -0
  249. package/include/sanitizer/hwasan_interface.h +109 -0
  250. package/include/sanitizer/linux_syscall_hooks.h +3112 -0
  251. package/include/sanitizer/lsan_interface.h +89 -0
  252. package/include/sanitizer/msan_interface.h +135 -0
  253. package/include/sanitizer/netbsd_syscall_hooks.h +5005 -0
  254. package/include/sanitizer/rtsan_interface.h +75 -0
  255. package/include/sanitizer/safestack_interface.h +50 -0
  256. package/include/sanitizer/scudo_interface.h +38 -0
  257. package/include/sanitizer/tsan_interface.h +316 -0
  258. package/include/sanitizer/tsan_interface_atomic.h +223 -0
  259. package/include/sanitizer/tysan_interface.h +36 -0
  260. package/include/sanitizer/ubsan_interface.h +64 -0
  261. package/include/serializeintrin.h +30 -0
  262. package/include/sgxintrin.h +60 -0
  263. package/include/sha512intrin.h +200 -0
  264. package/include/shaintrin.h +190 -0
  265. package/include/sifive_vector.h +192 -0
  266. package/include/sm3intrin.h +238 -0
  267. package/include/sm4evexintrin.h +32 -0
  268. package/include/sm4intrin.h +269 -0
  269. package/include/smmintrin.h +2352 -0
  270. package/include/spirvintrin.h +167 -0
  271. package/include/stdalign.h +24 -0
  272. package/include/stdarg.h +75 -0
  273. package/include/stdatomic.h +204 -0
  274. package/include/stdbool.h +39 -0
  275. package/include/stdckdint.h +42 -0
  276. package/include/stdcountof.h +15 -0
  277. package/include/stddef.h +139 -0
  278. package/include/stddefer.h +19 -0
  279. package/include/stdint.h +835 -0
  280. package/include/stdnoreturn.h +35 -0
  281. package/include/tbmintrin.h +128 -0
  282. package/include/tgmath.h +1368 -0
  283. package/include/tmmintrin.h +779 -0
  284. package/include/tsxldtrkintrin.h +56 -0
  285. package/include/uintrintrin.h +157 -0
  286. package/include/unwind.h +332 -0
  287. package/include/usermsrintrin.h +51 -0
  288. package/include/vadefs.h +51 -0
  289. package/include/vaesintrin.h +86 -0
  290. package/include/varargs.h +16 -0
  291. package/include/vecintrin.h +12868 -0
  292. package/include/velintrin.h +71 -0
  293. package/include/velintrin_approx.h +120 -0
  294. package/include/velintrin_gen.h +1257 -0
  295. package/include/vpclmulqdqintrin.h +30 -0
  296. package/include/waitpkgintrin.h +42 -0
  297. package/include/wasm_simd128.h +2160 -0
  298. package/include/wbnoinvdintrin.h +24 -0
  299. package/include/wmmintrin.h +23 -0
  300. package/include/x86gprintrin.h +49 -0
  301. package/include/x86intrin.h +35 -0
  302. package/include/xmmintrin.h +3176 -0
  303. package/include/xopintrin.h +780 -0
  304. package/include/xsavecintrin.h +84 -0
  305. package/include/xsaveintrin.h +63 -0
  306. package/include/xsaveoptintrin.h +34 -0
  307. package/include/xsavesintrin.h +44 -0
  308. package/include/xtestintrin.h +27 -0
  309. package/include/yvals_core.h +25 -0
  310. package/include/zos_wrappers/builtins.h +18 -0
  311. package/include/zos_wrappers/grp.h +19 -0
  312. package/include/zos_wrappers/locale.h +19 -0
  313. package/include/zos_wrappers/math.h +31 -0
  314. package/include/zos_wrappers/poll.h +19 -0
  315. package/include/zos_wrappers/stdlib.h +20 -0
  316. package/include/zos_wrappers/string.h +19 -0
  317. package/include/zos_wrappers/time.h +19 -0
  318. package/include/zos_wrappers/variant.h +19 -0
  319. package/index.js +5 -0
  320. package/lib/darwin/libclang_rt.asan_abi_ios.a +0 -0
  321. package/lib/darwin/libclang_rt.asan_abi_iossim.a +0 -0
  322. package/lib/darwin/libclang_rt.asan_abi_osx.a +0 -0
  323. package/lib/darwin/libclang_rt.asan_ios_dynamic.dylib +0 -0
  324. package/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
  325. package/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
  326. package/lib/darwin/libclang_rt.cc_kext.a +0 -0
  327. package/lib/darwin/libclang_rt.cc_kext_ios.a +0 -0
  328. package/lib/darwin/libclang_rt.fuzzer_interceptors_ios.a +0 -0
  329. package/lib/darwin/libclang_rt.fuzzer_interceptors_iossim.a +0 -0
  330. package/lib/darwin/libclang_rt.fuzzer_interceptors_osx.a +0 -0
  331. package/lib/darwin/libclang_rt.fuzzer_ios.a +0 -0
  332. package/lib/darwin/libclang_rt.fuzzer_iossim.a +0 -0
  333. package/lib/darwin/libclang_rt.fuzzer_no_main_ios.a +0 -0
  334. package/lib/darwin/libclang_rt.fuzzer_no_main_iossim.a +0 -0
  335. package/lib/darwin/libclang_rt.fuzzer_no_main_osx.a +0 -0
  336. package/lib/darwin/libclang_rt.fuzzer_osx.a +0 -0
  337. package/lib/darwin/libclang_rt.ios.a +0 -0
  338. package/lib/darwin/libclang_rt.iossim.a +0 -0
  339. package/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib +0 -0
  340. package/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib +0 -0
  341. package/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib +0 -0
  342. package/lib/darwin/libclang_rt.osx.a +0 -0
  343. package/lib/darwin/libclang_rt.profile_ios.a +0 -0
  344. package/lib/darwin/libclang_rt.profile_iossim.a +0 -0
  345. package/lib/darwin/libclang_rt.profile_osx.a +0 -0
  346. package/lib/darwin/libclang_rt.rtsan_ios_dynamic.dylib +0 -0
  347. package/lib/darwin/libclang_rt.rtsan_iossim_dynamic.dylib +0 -0
  348. package/lib/darwin/libclang_rt.rtsan_osx_dynamic.dylib +0 -0
  349. package/lib/darwin/libclang_rt.stats_client_ios.a +0 -0
  350. package/lib/darwin/libclang_rt.stats_client_iossim.a +0 -0
  351. package/lib/darwin/libclang_rt.stats_client_osx.a +0 -0
  352. package/lib/darwin/libclang_rt.stats_ios_dynamic.dylib +0 -0
  353. package/lib/darwin/libclang_rt.stats_iossim_dynamic.dylib +0 -0
  354. package/lib/darwin/libclang_rt.stats_osx_dynamic.dylib +0 -0
  355. package/lib/darwin/libclang_rt.tsan_ios_dynamic.dylib +0 -0
  356. package/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib +0 -0
  357. package/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib +0 -0
  358. package/lib/darwin/libclang_rt.tysan_ios_dynamic.dylib +0 -0
  359. package/lib/darwin/libclang_rt.tysan_iossim_dynamic.dylib +0 -0
  360. package/lib/darwin/libclang_rt.tysan_osx_dynamic.dylib +0 -0
  361. package/lib/darwin/libclang_rt.ubsan_ios_dynamic.dylib +0 -0
  362. package/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
  363. package/lib/darwin/libclang_rt.ubsan_minimal_ios.a +0 -0
  364. package/lib/darwin/libclang_rt.ubsan_minimal_ios_dynamic.dylib +0 -0
  365. package/lib/darwin/libclang_rt.ubsan_minimal_iossim.a +0 -0
  366. package/lib/darwin/libclang_rt.ubsan_minimal_iossim_dynamic.dylib +0 -0
  367. package/lib/darwin/libclang_rt.ubsan_minimal_osx.a +0 -0
  368. package/lib/darwin/libclang_rt.ubsan_minimal_osx_dynamic.dylib +0 -0
  369. package/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
  370. package/package.json +40 -1
  371. package/share/asan_ignorelist.txt +14 -0
  372. package/share/cfi_ignorelist.txt +17 -0
@@ -0,0 +1,526 @@
1
+ /*===---- __clang_cuda_runtime_wrapper.h - CUDA runtime support -------------===
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
+ /*
11
+ * WARNING: This header is intended to be directly -include'd by
12
+ * the compiler and is not supposed to be included by users.
13
+ *
14
+ * CUDA headers are implemented in a way that currently makes it
15
+ * impossible for user code to #include directly when compiling with
16
+ * Clang. They present different view of CUDA-supplied functions
17
+ * depending on where in NVCC's compilation pipeline the headers are
18
+ * included. Neither of these modes provides function definitions with
19
+ * correct attributes, so we use preprocessor to force the headers
20
+ * into a form that Clang can use.
21
+ *
22
+ * Similarly to NVCC which -include's cuda_runtime.h, Clang -include's
23
+ * this file during every CUDA compilation.
24
+ */
25
+
26
+ #ifndef __CLANG_CUDA_RUNTIME_WRAPPER_H__
27
+ #define __CLANG_CUDA_RUNTIME_WRAPPER_H__
28
+
29
+ #if defined(__CUDA__) && defined(__clang__)
30
+
31
+ // Include some forward declares that must come before cmath.
32
+ #include <__clang_cuda_math_forward_declares.h>
33
+
34
+ // Define __CUDACC__ early as libstdc++ standard headers with GNU extensions
35
+ // enabled depend on it to avoid using __float128, which is unsupported in
36
+ // CUDA.
37
+ #define __CUDACC__ 1
38
+
39
+ // Include some standard headers to avoid CUDA headers including them
40
+ // while some required macros (like __THROW) are in a weird state.
41
+ #include <climits>
42
+ #include <cmath>
43
+ #include <cstdlib>
44
+ #include <stdlib.h>
45
+ #include <string.h>
46
+ #undef __CUDACC__
47
+
48
+ // math_functions.h from CUDA 13.2+ defines _NV_RSQRT_SPECIFIER.
49
+ // Clang does not include it, so we need to define it ourselves.
50
+ #if defined(__GNUC__) && defined(__GLIBC_PREREQ)
51
+ #if __GLIBC_PREREQ(2, 42)
52
+ #define _NV_RSQRT_SPECIFIER noexcept(true)
53
+ #endif
54
+ #endif
55
+
56
+ #ifndef _NV_RSQRT_SPECIFIER
57
+ #define _NV_RSQRT_SPECIFIER
58
+ #endif
59
+
60
+ // Preserve common macros that will be changed below by us or by CUDA
61
+ // headers.
62
+ #pragma push_macro("__THROW")
63
+ #pragma push_macro("__CUDA_ARCH__")
64
+
65
+ // WARNING: Preprocessor hacks below are based on specific details of
66
+ // CUDA-7.x headers and are not expected to work with any other
67
+ // version of CUDA headers.
68
+ #include "cuda.h"
69
+ #if !defined(CUDA_VERSION)
70
+ #error "cuda.h did not define CUDA_VERSION"
71
+ #elif CUDA_VERSION < 7000
72
+ #error "Unsupported CUDA version!"
73
+ #endif
74
+
75
+ #pragma push_macro("__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__")
76
+ #if CUDA_VERSION >= 10000
77
+ #define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__
78
+ #endif
79
+
80
+ // Make largest subset of device functions available during host
81
+ // compilation.
82
+ #ifndef __CUDA_ARCH__
83
+ #define __CUDA_ARCH__ 9999
84
+ #endif
85
+
86
+ #include "__clang_cuda_builtin_vars.h"
87
+
88
+ // No need for device_launch_parameters.h as __clang_cuda_builtin_vars.h above
89
+ // has taken care of builtin variables declared in the file.
90
+ #define __DEVICE_LAUNCH_PARAMETERS_H__
91
+
92
+ // {math,device}_functions.h only have declarations of the
93
+ // functions. We don't need them as we're going to pull in their
94
+ // definitions from .hpp files.
95
+ #define __DEVICE_FUNCTIONS_H__
96
+ #define __MATH_FUNCTIONS_H__
97
+ #define __COMMON_FUNCTIONS_H__
98
+ // device_functions_decls is replaced by __clang_cuda_device_functions.h
99
+ // included below.
100
+ #define __DEVICE_FUNCTIONS_DECLS_H__
101
+
102
+ #undef __CUDACC__
103
+ #if CUDA_VERSION < 9000
104
+ #define __CUDABE__
105
+ #else
106
+ #define __CUDACC__ 1
107
+ #define __CUDA_LIBDEVICE__
108
+ #endif
109
+ // Disables definitions of device-side runtime support stubs in
110
+ // cuda_device_runtime_api.h
111
+ #include "host_defines.h"
112
+ #undef __CUDACC__
113
+ #include "driver_types.h"
114
+ #include "host_config.h"
115
+
116
+ // Temporarily replace "nv_weak" with weak, so __attribute__((nv_weak)) in
117
+ // cuda_device_runtime_api.h ends up being __attribute__((weak)) which is the
118
+ // functional equivalent of what we need.
119
+ #pragma push_macro("nv_weak")
120
+ #define nv_weak weak
121
+ #undef __CUDABE__
122
+ #undef __CUDA_LIBDEVICE__
123
+ #define __CUDACC__ 1
124
+ #include "cuda_runtime.h"
125
+
126
+ #pragma pop_macro("nv_weak")
127
+ #undef __CUDACC__
128
+ #define __CUDABE__
129
+
130
+ // CUDA headers use __nvvm_memcpy and __nvvm_memset which Clang does
131
+ // not have at the moment. Emulate them with a builtin memcpy/memset.
132
+ #define __nvvm_memcpy(s, d, n, a) __builtin_memcpy(s, d, n)
133
+ #define __nvvm_memset(d, c, n, a) __builtin_memset(d, c, n)
134
+
135
+ #if CUDA_VERSION < 9000
136
+ #include "crt/device_runtime.h"
137
+ #endif
138
+ #include "crt/host_runtime.h"
139
+ // device_runtime.h defines __cxa_* macros that will conflict with
140
+ // cxxabi.h.
141
+ // FIXME: redefine these as __device__ functions.
142
+ #undef __cxa_vec_ctor
143
+ #undef __cxa_vec_cctor
144
+ #undef __cxa_vec_dtor
145
+ #undef __cxa_vec_new
146
+ #undef __cxa_vec_new2
147
+ #undef __cxa_vec_new3
148
+ #undef __cxa_vec_delete2
149
+ #undef __cxa_vec_delete
150
+ #undef __cxa_vec_delete3
151
+ #undef __cxa_pure_virtual
152
+
153
+ // math_functions.hpp expects this host function be defined on MacOS, but it
154
+ // ends up not being there because of the games we play here. Just define it
155
+ // ourselves; it's simple enough.
156
+ #ifdef __APPLE__
157
+ inline __host__ double __signbitd(double x) {
158
+ return std::signbit(x);
159
+ }
160
+ #endif
161
+
162
+ // CUDA 9.1 no longer provides declarations for libdevice functions, so we need
163
+ // to provide our own.
164
+ #include <__clang_cuda_libdevice_declares.h>
165
+
166
+ // Wrappers for many device-side standard library functions, incl. math
167
+ // functions, became compiler builtins in CUDA-9 and have been removed from the
168
+ // CUDA headers. Clang now provides its own implementation of the wrappers.
169
+ #if CUDA_VERSION >= 9000
170
+ #include <__clang_cuda_device_functions.h>
171
+ #include <__clang_cuda_math.h>
172
+ #endif
173
+
174
+ // __THROW is redefined to be empty by device_functions_decls.h in CUDA. Clang's
175
+ // counterpart does not do it, so we need to make it empty here to keep
176
+ // following CUDA includes happy.
177
+ #undef __THROW
178
+ #define __THROW
179
+
180
+ // CUDA 8.0.41 relies on __USE_FAST_MATH__ and __CUDA_PREC_DIV's values.
181
+ // Previous versions used to check whether they are defined or not.
182
+ // CU_DEVICE_INVALID macro is only defined in 8.0.41, so we use it
183
+ // here to detect the switch.
184
+
185
+ #if defined(CU_DEVICE_INVALID)
186
+ #if !defined(__USE_FAST_MATH__)
187
+ #define __USE_FAST_MATH__ 0
188
+ #endif
189
+
190
+ #if !defined(__CUDA_PREC_DIV)
191
+ #define __CUDA_PREC_DIV 0
192
+ #endif
193
+ #endif
194
+
195
+ // Temporarily poison __host__ macro to ensure it's not used by any of
196
+ // the headers we're about to include.
197
+ #pragma push_macro("__host__")
198
+ #define __host__ UNEXPECTED_HOST_ATTRIBUTE
199
+
200
+ // device_functions.hpp and math_functions*.hpp use 'static
201
+ // __forceinline__' (with no __device__) for definitions of device
202
+ // functions. Temporarily redefine __forceinline__ to include
203
+ // __device__.
204
+ #pragma push_macro("__forceinline__")
205
+ #define __forceinline__ __device__ __inline__ __attribute__((always_inline))
206
+ #if CUDA_VERSION < 9000
207
+ #include "device_functions.hpp"
208
+ #endif
209
+
210
+ // math_function.hpp uses the __USE_FAST_MATH__ macro to determine whether we
211
+ // get the slow-but-accurate or fast-but-inaccurate versions of functions like
212
+ // sin and exp. This is controlled in clang by -fgpu-approx-transcendentals.
213
+ //
214
+ // device_functions.hpp uses __USE_FAST_MATH__ for a different purpose (fast vs.
215
+ // slow divides), so we need to scope our define carefully here.
216
+ #pragma push_macro("__USE_FAST_MATH__")
217
+ #if defined(__CLANG_GPU_APPROX_TRANSCENDENTALS__)
218
+ #define __USE_FAST_MATH__ 1
219
+ #endif
220
+
221
+ #if CUDA_VERSION >= 9000
222
+ #include "crt/math_functions.hpp"
223
+ #else
224
+ #include "math_functions.hpp"
225
+ #endif
226
+
227
+ #pragma pop_macro("__USE_FAST_MATH__")
228
+
229
+ #if CUDA_VERSION < 9000
230
+ #include "math_functions_dbl_ptx3.hpp"
231
+ #endif
232
+ #pragma pop_macro("__forceinline__")
233
+
234
+ // Pull in host-only functions that are only available when neither
235
+ // __CUDACC__ nor __CUDABE__ are defined.
236
+ #undef __MATH_FUNCTIONS_HPP__
237
+ #undef __CUDABE__
238
+ #if CUDA_VERSION < 9000
239
+ #include "math_functions.hpp"
240
+ #endif
241
+ // Alas, additional overloads for these functions are hard to get to.
242
+ // Considering that we only need these overloads for a few functions,
243
+ // we can provide them here.
244
+ static inline float rsqrt(float __a) { return rsqrtf(__a); }
245
+ static inline float rcbrt(float __a) { return rcbrtf(__a); }
246
+ static inline float sinpi(float __a) { return sinpif(__a); }
247
+ static inline float cospi(float __a) { return cospif(__a); }
248
+ static inline void sincospi(float __a, float *__b, float *__c) {
249
+ return sincospif(__a, __b, __c);
250
+ }
251
+ static inline float erfcinv(float __a) { return erfcinvf(__a); }
252
+ static inline float normcdfinv(float __a) { return normcdfinvf(__a); }
253
+ static inline float normcdf(float __a) { return normcdff(__a); }
254
+ static inline float erfcx(float __a) { return erfcxf(__a); }
255
+
256
+ #if CUDA_VERSION < 9000
257
+ // For some reason single-argument variant is not always declared by
258
+ // CUDA headers. Alas, device_functions.hpp included below needs it.
259
+ static inline __device__ void __brkpt(int __c) { __brkpt(); }
260
+ #endif
261
+
262
+ // Now include *.hpp with definitions of various GPU functions. Alas,
263
+ // a lot of thins get declared/defined with __host__ attribute which
264
+ // we don't want and we have to define it out. We also have to include
265
+ // {device,math}_functions.hpp again in order to extract the other
266
+ // branch of #if/else inside.
267
+ #define __host__
268
+ #undef __CUDABE__
269
+ #define __CUDACC__ 1
270
+ #if CUDA_VERSION >= 9000
271
+ // Some atomic functions became compiler builtins in CUDA-9 , so we need their
272
+ // declarations.
273
+ #include "device_atomic_functions.h"
274
+ #endif
275
+ #undef __DEVICE_FUNCTIONS_HPP__
276
+ #include "device_atomic_functions.hpp"
277
+ #if CUDA_VERSION >= 9000
278
+ #include "crt/device_functions.hpp"
279
+ #include "crt/device_double_functions.hpp"
280
+ #else
281
+ #include "device_functions.hpp"
282
+ #define __CUDABE__
283
+ #include "device_double_functions.h"
284
+ #undef __CUDABE__
285
+ #endif
286
+ #include "sm_20_atomic_functions.hpp"
287
+ // Predicate functions used in `__builtin_assume` need to have no side effect.
288
+ // However, sm_20_intrinsics.hpp doesn't define them with neither pure nor
289
+ // const attribute. Rename definitions from sm_20_intrinsics.hpp and re-define
290
+ // them as pure ones.
291
+ #pragma push_macro("__isGlobal")
292
+ #pragma push_macro("__isShared")
293
+ #pragma push_macro("__isConstant")
294
+ #pragma push_macro("__isLocal")
295
+ #define __isGlobal __ignored_cuda___isGlobal
296
+ #define __isShared __ignored_cuda___isShared
297
+ #define __isConstant __ignored_cuda___isConstant
298
+ #define __isLocal __ignored_cuda___isLocal
299
+ #include "sm_20_intrinsics.hpp"
300
+ #pragma pop_macro("__isGlobal")
301
+ #pragma pop_macro("__isShared")
302
+ #pragma pop_macro("__isConstant")
303
+ #pragma pop_macro("__isLocal")
304
+ #pragma push_macro("__DEVICE__")
305
+ #define __DEVICE__ static __device__ __forceinline__ __attribute__((const))
306
+ __DEVICE__ unsigned int __isGlobal(const void *p) {
307
+ return __nvvm_isspacep_global(p);
308
+ }
309
+ __DEVICE__ unsigned int __isShared(const void *p) {
310
+ return __nvvm_isspacep_shared(p);
311
+ }
312
+ __DEVICE__ unsigned int __isConstant(const void *p) {
313
+ return __nvvm_isspacep_const(p);
314
+ }
315
+ __DEVICE__ unsigned int __isLocal(const void *p) {
316
+ return __nvvm_isspacep_local(p);
317
+ }
318
+ #pragma pop_macro("__DEVICE__")
319
+ #include "sm_32_atomic_functions.hpp"
320
+
321
+ // Don't include sm_30_intrinsics.h and sm_32_intrinsics.h. These define the
322
+ // __shfl and __ldg intrinsics using inline (volatile) asm, but we want to
323
+ // define them using builtins so that the optimizer can reason about and across
324
+ // these instructions. In particular, using intrinsics for ldg gets us the
325
+ // [addr+imm] addressing mode, which, although it doesn't actually exist in the
326
+ // hardware, seems to generate faster machine code because ptxas can more easily
327
+ // reason about our code.
328
+
329
+ #if CUDA_VERSION >= 8000
330
+ #pragma push_macro("__CUDA_ARCH__")
331
+ #undef __CUDA_ARCH__
332
+ #include "sm_60_atomic_functions.hpp"
333
+ #include "sm_61_intrinsics.hpp"
334
+ #pragma pop_macro("__CUDA_ARCH__")
335
+ #endif
336
+
337
+ #undef __MATH_FUNCTIONS_HPP__
338
+
339
+ // math_functions.hpp defines ::signbit as a __host__ __device__ function. This
340
+ // conflicts with libstdc++'s constexpr ::signbit, so we have to rename
341
+ // math_function.hpp's ::signbit. It's guarded by #undef signbit, but that's
342
+ // conditional on __GNUC__. :)
343
+ #pragma push_macro("signbit")
344
+ #pragma push_macro("__GNUC__")
345
+ #undef __GNUC__
346
+ #define signbit __ignored_cuda_signbit
347
+
348
+ // CUDA-9 omits device-side definitions of some math functions if it sees
349
+ // include guard from math.h wrapper from libstdc++. We have to undo the header
350
+ // guard temporarily to get the definitions we need.
351
+ #pragma push_macro("_GLIBCXX_MATH_H")
352
+ #pragma push_macro("_LIBCPP_VERSION")
353
+ #if CUDA_VERSION >= 9000
354
+ #undef _GLIBCXX_MATH_H
355
+ // We also need to undo another guard that checks for libc++ 3.8+
356
+ #ifdef _LIBCPP_VERSION
357
+ #define _LIBCPP_VERSION 3700
358
+ #endif
359
+ #endif
360
+
361
+ #if CUDA_VERSION >= 9000
362
+ #include "crt/math_functions.hpp"
363
+ #else
364
+ #include "math_functions.hpp"
365
+ #endif
366
+ #pragma pop_macro("_GLIBCXX_MATH_H")
367
+ #pragma pop_macro("_LIBCPP_VERSION")
368
+ #pragma pop_macro("__GNUC__")
369
+ #pragma pop_macro("signbit")
370
+
371
+ #pragma pop_macro("__host__")
372
+
373
+ // __clang_cuda_texture_intrinsics.h must be included first in order to provide
374
+ // implementation for __nv_tex_surf_handler that CUDA's headers depend on.
375
+ // The implementation requires c++11 and only works with CUDA-9 or newer.
376
+ #if __cplusplus >= 201103L && CUDA_VERSION >= 9000
377
+ // clang-format off
378
+ #include <__clang_cuda_texture_intrinsics.h>
379
+ // clang-format on
380
+ #else
381
+ #if CUDA_VERSION >= 9000
382
+ // Provide a hint that texture support needs C++11.
383
+ template <typename T> struct __nv_tex_needs_cxx11 {
384
+ const static bool value = false;
385
+ };
386
+ template <class T>
387
+ __host__ __device__ void __nv_tex_surf_handler(const char *name, T *ptr,
388
+ cudaTextureObject_t obj,
389
+ float x) {
390
+ _Static_assert(__nv_tex_needs_cxx11<T>::value,
391
+ "Texture support requires C++11");
392
+ }
393
+ #else
394
+ // Textures in CUDA-8 and older are not supported by clang.There's no
395
+ // convenient way to intercept texture use in these versions, so we can't
396
+ // produce a meaningful error. The source code that attempts to use textures
397
+ // will continue to fail as it does now.
398
+ #endif // CUDA_VERSION
399
+ #endif // __cplusplus >= 201103L && CUDA_VERSION >= 9000
400
+ #include "surface_indirect_functions.h"
401
+ #if CUDA_VERSION < 13000
402
+ // Direct texture fetch functions had been deprecated since CUDA-11.
403
+ // The file in CUDA-12 only carried unused texture types, and is no longer
404
+ // needed.
405
+ #include "texture_fetch_functions.h"
406
+ #endif // CUDA_VERSION < 13000
407
+ #include "texture_indirect_functions.h"
408
+
409
+ // Restore state of __CUDA_ARCH__ and __THROW we had on entry.
410
+ #pragma pop_macro("__CUDA_ARCH__")
411
+ #pragma pop_macro("__THROW")
412
+
413
+ // Set up compiler macros expected to be seen during compilation.
414
+ #undef __CUDABE__
415
+ #define __CUDACC__ 1
416
+
417
+ extern "C" {
418
+ // Device-side CUDA system calls.
419
+ // http://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/index.html#system-calls
420
+ // We need these declarations and wrappers for device-side
421
+ // malloc/free/printf calls to work without relying on
422
+ // -fcuda-disable-target-call-checks option.
423
+ __device__ int vprintf(const char *, const char *);
424
+ __device__ void free(void *) __attribute((nothrow));
425
+ __device__ void *malloc(size_t) __attribute((nothrow)) __attribute__((malloc));
426
+
427
+ // __assertfail() used to have a `noreturn` attribute. Unfortunately that
428
+ // contributed to triggering the longstanding bug in ptxas when assert was used
429
+ // in sufficiently convoluted code. See
430
+ // https://bugs.llvm.org/show_bug.cgi?id=27738 for the details.
431
+ __device__ void __assertfail(const char *__message, const char *__file,
432
+ unsigned __line, const char *__function,
433
+ size_t __charSize);
434
+
435
+ // In order for standard assert() macro on linux to work we need to
436
+ // provide device-side __assert_fail()
437
+ __device__ static inline void __assert_fail(const char *__message,
438
+ const char *__file, unsigned __line,
439
+ const char *__function) {
440
+ __assertfail(__message, __file, __line, __function, sizeof(char));
441
+ }
442
+
443
+ // Clang will convert printf into vprintf, but we still need
444
+ // device-side declaration for it.
445
+ __device__ int printf(const char *, ...);
446
+ } // extern "C"
447
+
448
+ // We also need device-side std::malloc and std::free.
449
+ namespace std {
450
+ __device__ static inline void free(void *__ptr) { ::free(__ptr); }
451
+ __device__ static inline void *malloc(size_t __size) {
452
+ return ::malloc(__size);
453
+ }
454
+ } // namespace std
455
+
456
+ // Out-of-line implementations from __clang_cuda_builtin_vars.h. These need to
457
+ // come after we've pulled in the definition of uint3 and dim3.
458
+
459
+ __device__ inline __cuda_builtin_threadIdx_t::operator dim3() const {
460
+ return dim3(x, y, z);
461
+ }
462
+
463
+ __device__ inline __cuda_builtin_threadIdx_t::operator uint3() const {
464
+ return {x, y, z};
465
+ }
466
+
467
+ __device__ inline __cuda_builtin_blockIdx_t::operator dim3() const {
468
+ return dim3(x, y, z);
469
+ }
470
+
471
+ __device__ inline __cuda_builtin_blockIdx_t::operator uint3() const {
472
+ return {x, y, z};
473
+ }
474
+
475
+ __device__ inline __cuda_builtin_blockDim_t::operator dim3() const {
476
+ return dim3(x, y, z);
477
+ }
478
+
479
+ __device__ inline __cuda_builtin_blockDim_t::operator uint3() const {
480
+ return {x, y, z};
481
+ }
482
+
483
+ __device__ inline __cuda_builtin_gridDim_t::operator dim3() const {
484
+ return dim3(x, y, z);
485
+ }
486
+
487
+ __device__ inline __cuda_builtin_gridDim_t::operator uint3() const {
488
+ return {x, y, z};
489
+ }
490
+
491
+ #include <__clang_cuda_cmath.h>
492
+ #include <__clang_cuda_intrinsics.h>
493
+ #include <__clang_cuda_complex_builtins.h>
494
+
495
+ // curand_mtgp32_kernel helpfully redeclares blockDim and threadIdx in host
496
+ // mode, giving them their "proper" types of dim3 and uint3. This is
497
+ // incompatible with the types we give in __clang_cuda_builtin_vars.h. As as
498
+ // hack, force-include the header (nvcc doesn't include it by default) but
499
+ // redefine dim3 and uint3 to our builtin types. (Thankfully dim3 and uint3 are
500
+ // only used here for the redeclarations of blockDim and threadIdx.)
501
+ #pragma push_macro("dim3")
502
+ #pragma push_macro("uint3")
503
+ #define dim3 __cuda_builtin_blockDim_t
504
+ #define uint3 __cuda_builtin_threadIdx_t
505
+ #include "curand_mtgp32_kernel.h"
506
+ #pragma pop_macro("dim3")
507
+ #pragma pop_macro("uint3")
508
+ #pragma pop_macro("__USE_FAST_MATH__")
509
+ #pragma pop_macro("__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__")
510
+
511
+ // CUDA runtime uses this undocumented function to access kernel launch
512
+ // configuration. The declaration is in crt/device_functions.h but that file
513
+ // includes a lot of other stuff we don't want. Instead, we'll provide our own
514
+ // declaration for it here.
515
+ #if CUDA_VERSION >= 9020
516
+ extern "C" unsigned __cudaPushCallConfiguration(dim3 gridDim, dim3 blockDim,
517
+ size_t sharedMem = 0,
518
+ void *stream = 0);
519
+ #endif
520
+
521
+ // Enable libcudacxx cooperative groups cluster functionality when using the
522
+ // Clang CUDA runtime wrapper.
523
+ #define _CG_CLUSTER_INTRINSICS_AVAILABLE 1
524
+
525
+ #endif // __CUDA__
526
+ #endif // __CLANG_CUDA_RUNTIME_WRAPPER_H__