@cpp-linter/clang-tidy-linux-arm64 17.0.6 → 18.1.8
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.
- package/README.md +2 -2
- package/bin/clang-tidy +2 -2
- package/lib/clang/{17 → 18}/include/__clang_cuda_device_functions.h +2 -2
- package/lib/clang/{17 → 18}/include/__clang_cuda_libdevice_declares.h +2 -2
- package/lib/clang/{17 → 18}/include/__clang_cuda_math.h +2 -2
- package/lib/clang/{17 → 18}/include/__clang_cuda_runtime_wrapper.h +2 -2
- package/lib/clang/{17 → 18}/include/__clang_hip_math.h +192 -171
- package/lib/clang/{17 → 18}/include/__clang_hip_runtime_wrapper.h +34 -26
- package/lib/clang/18/include/__stdarg___gnuc_va_list.h +13 -0
- package/lib/clang/18/include/__stdarg___va_copy.h +12 -0
- package/lib/clang/18/include/__stdarg_va_arg.h +22 -0
- package/lib/clang/18/include/__stdarg_va_copy.h +12 -0
- package/lib/clang/18/include/__stdarg_va_list.h +13 -0
- package/lib/clang/{17 → 18}/include/__stddef_max_align_t.h +1 -1
- package/lib/clang/18/include/__stddef_null.h +29 -0
- package/lib/clang/18/include/__stddef_nullptr_t.h +29 -0
- package/lib/clang/18/include/__stddef_offsetof.h +17 -0
- package/lib/clang/18/include/__stddef_ptrdiff_t.h +20 -0
- package/lib/clang/18/include/__stddef_rsize_t.h +20 -0
- package/lib/clang/18/include/__stddef_size_t.h +20 -0
- package/lib/clang/18/include/__stddef_unreachable.h +21 -0
- package/lib/clang/18/include/__stddef_wchar_t.h +28 -0
- package/lib/clang/18/include/__stddef_wint_t.h +15 -0
- package/lib/clang/{17/include/adxintrin.h → 18/include/adcintrin.h} +27 -94
- package/lib/clang/18/include/adxintrin.h +102 -0
- package/lib/clang/{17 → 18}/include/altivec.h +31 -12
- package/lib/clang/{17 → 18}/include/ammintrin.h +4 -4
- package/lib/clang/{17 → 18}/include/arm_acle.h +111 -31
- package/lib/clang/{17 → 18}/include/arm_neon.h +85 -327
- package/lib/clang/18/include/arm_sme.h +2412 -0
- package/lib/clang/{17 → 18}/include/arm_sve.h +7386 -351
- package/lib/clang/18/include/arm_vector_types.h +345 -0
- package/lib/clang/{17 → 18}/include/avx2intrin.h +24 -3
- package/lib/clang/{17 → 18}/include/avx512bf16intrin.h +3 -2
- package/lib/clang/{17 → 18}/include/avx512bitalgintrin.h +4 -1
- package/lib/clang/{17 → 18}/include/avx512bwintrin.h +28 -38
- package/lib/clang/{17 → 18}/include/avx512cdintrin.h +3 -1
- package/lib/clang/{17 → 18}/include/avx512dqintrin.h +4 -2
- package/lib/clang/{17 → 18}/include/avx512fintrin.h +7 -3
- package/lib/clang/{17 → 18}/include/avx512fp16intrin.h +6 -4
- package/lib/clang/{17 → 18}/include/avx512ifmaintrin.h +3 -1
- package/lib/clang/{17 → 18}/include/avx512ifmavlintrin.h +8 -2
- package/lib/clang/{17 → 18}/include/avx512pfintrin.h +0 -5
- package/lib/clang/{17 → 18}/include/avx512vbmi2intrin.h +1 -1
- package/lib/clang/{17 → 18}/include/avx512vbmiintrin.h +3 -2
- package/lib/clang/{17 → 18}/include/avx512vbmivlintrin.h +8 -3
- package/lib/clang/{17 → 18}/include/avx512vlbf16intrin.h +8 -6
- package/lib/clang/{17 → 18}/include/avx512vlbitalgintrin.h +8 -2
- package/lib/clang/{17 → 18}/include/avx512vlbwintrin.h +8 -2
- package/lib/clang/{17 → 18}/include/avx512vlcdintrin.h +8 -3
- package/lib/clang/{17 → 18}/include/avx512vldqintrin.h +8 -2
- package/lib/clang/{17 → 18}/include/avx512vlfp16intrin.h +2 -2
- package/lib/clang/{17 → 18}/include/avx512vlintrin.h +8 -2
- package/lib/clang/{17 → 18}/include/avx512vlvbmi2intrin.h +8 -2
- package/lib/clang/{17 → 18}/include/avx512vlvnniintrin.h +8 -2
- package/lib/clang/{17 → 18}/include/avx512vlvp2intersectintrin.h +6 -4
- package/lib/clang/{17 → 18}/include/avx512vnniintrin.h +3 -2
- package/lib/clang/{17 → 18}/include/avx512vp2intersectintrin.h +3 -2
- package/lib/clang/{17 → 18}/include/avx512vpopcntdqintrin.h +3 -1
- package/lib/clang/{17 → 18}/include/avx512vpopcntdqvlintrin.h +6 -2
- package/lib/clang/{17 → 18}/include/avxintrin.h +9 -5
- package/lib/clang/{17 → 18}/include/bmiintrin.h +231 -46
- package/lib/clang/{17 → 18}/include/emmintrin.h +10 -10
- package/lib/clang/{17 → 18}/include/gfniintrin.h +23 -6
- package/lib/clang/18/include/hlsl/hlsl_intrinsics.h +624 -0
- package/lib/clang/18/include/ia32intrin.h +863 -0
- package/lib/clang/{17 → 18}/include/immintrin.h +66 -3
- package/lib/clang/{17 → 18}/include/intrin.h +16 -0
- package/lib/clang/{17 → 18}/include/larchintrin.h +13 -1
- package/lib/clang/18/include/lasxintrin.h +3884 -0
- package/lib/clang/{17 → 18}/include/limits.h +2 -4
- package/lib/clang/{17/include/llvm_libc_wrappers/stdio.h → 18/include/llvm_libc_wrappers/assert.h} +7 -7
- package/lib/clang/{17 → 18}/include/llvm_libc_wrappers/ctype.h +17 -0
- package/lib/clang/18/include/llvm_libc_wrappers/stdio.h +80 -0
- package/lib/clang/{17 → 18}/include/llvm_libc_wrappers/stdlib.h +4 -1
- package/lib/clang/18/include/llvm_libc_wrappers/string.h +96 -0
- package/lib/clang/{17/include/llvm_libc_wrappers/string.h → 18/include/llvm_libc_wrappers/time.h} +9 -12
- package/lib/clang/18/include/lsxintrin.h +3750 -0
- package/lib/clang/{17 → 18}/include/mmintrin.h +7 -5
- package/lib/clang/{17 → 18}/include/module.modulemap +155 -2
- package/lib/clang/{17 → 18}/include/opencl-c-base.h +5 -0
- package/lib/clang/{17 → 18}/include/openmp_wrappers/cmath +1 -1
- package/lib/clang/{17 → 18}/include/pmmintrin.h +3 -2
- package/lib/clang/18/include/ppc_wrappers/nmmintrin.h +26 -0
- package/lib/clang/{17 → 18}/include/ppc_wrappers/smmintrin.h +35 -15
- package/lib/clang/18/include/riscv_bitmanip.h +195 -0
- package/lib/clang/18/include/riscv_crypto.h +170 -0
- package/lib/clang/{17 → 18}/include/riscv_ntlh.h +3 -5
- package/lib/clang/{17 → 18}/include/riscv_vector.h +31 -0
- package/lib/clang/{17 → 18}/include/smmintrin.h +3 -3
- package/lib/clang/{17 → 18}/include/stdalign.h +1 -3
- package/lib/clang/18/include/stdarg.h +79 -0
- package/lib/clang/{17 → 18}/include/stdatomic.h +3 -5
- package/lib/clang/18/include/stdckdint.h +42 -0
- package/lib/clang/18/include/stddef.h +123 -0
- package/lib/clang/{17 → 18}/include/stdint.h +19 -48
- package/lib/clang/{17 → 18}/include/stdnoreturn.h +2 -2
- package/lib/clang/{17 → 18}/include/tmmintrin.h +7 -2
- package/lib/clang/18/include/usermsrintrin.h +51 -0
- package/lib/clang/{17 → 18}/include/vaesintrin.h +4 -2
- package/lib/clang/{17 → 18}/include/vecintrin.h +217 -199
- package/lib/clang/{17 → 18}/include/x86gprintrin.h +5 -0
- package/lib/clang/{17 → 18}/include/xmmintrin.h +9 -5
- package/package.json +6 -6
- package/lib/clang/17/include/arm_sme_draft_spec_subject_to_change.h +0 -642
- package/lib/clang/17/include/hlsl/hlsl_intrinsics.h +0 -480
- package/lib/clang/17/include/ia32intrin.h +0 -441
- package/lib/clang/17/include/stdarg.h +0 -51
- package/lib/clang/17/include/stddef.h +0 -133
- /package/lib/clang/{17 → 18}/include/__clang_cuda_builtin_vars.h +0 -0
- /package/lib/clang/{17 → 18}/include/__clang_cuda_cmath.h +0 -0
- /package/lib/clang/{17 → 18}/include/__clang_cuda_complex_builtins.h +0 -0
- /package/lib/clang/{17 → 18}/include/__clang_cuda_intrinsics.h +0 -0
- /package/lib/clang/{17 → 18}/include/__clang_cuda_math_forward_declares.h +0 -0
- /package/lib/clang/{17 → 18}/include/__clang_cuda_texture_intrinsics.h +0 -0
- /package/lib/clang/{17 → 18}/include/__clang_hip_cmath.h +0 -0
- /package/lib/clang/{17 → 18}/include/__clang_hip_libdevice_declares.h +0 -0
- /package/lib/clang/{17 → 18}/include/__clang_hip_stdlib.h +0 -0
- /package/lib/clang/{17 → 18}/include/__wmmintrin_aes.h +0 -0
- /package/lib/clang/{17 → 18}/include/__wmmintrin_pclmul.h +0 -0
- /package/lib/clang/{17 → 18}/include/amxcomplexintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/amxfp16intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/amxintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/arm64intr.h +0 -0
- /package/lib/clang/{17 → 18}/include/arm_bf16.h +0 -0
- /package/lib/clang/{17 → 18}/include/arm_cde.h +0 -0
- /package/lib/clang/{17 → 18}/include/arm_cmse.h +0 -0
- /package/lib/clang/{17 → 18}/include/arm_fp16.h +0 -0
- /package/lib/clang/{17 → 18}/include/arm_mve.h +0 -0
- /package/lib/clang/{17 → 18}/include/arm_neon_sve_bridge.h +0 -0
- /package/lib/clang/{17 → 18}/include/armintr.h +0 -0
- /package/lib/clang/{17 → 18}/include/avx512erintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/avxifmaintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/avxneconvertintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/avxvnniint16intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/avxvnniint8intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/avxvnniintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/bmi2intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/builtins.h +0 -0
- /package/lib/clang/{17 → 18}/include/cet.h +0 -0
- /package/lib/clang/{17 → 18}/include/cetintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/cldemoteintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/clflushoptintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/clwbintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/clzerointrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/cmpccxaddintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/cpuid.h +0 -0
- /package/lib/clang/{17 → 18}/include/crc32intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/cuda_wrappers/algorithm +0 -0
- /package/lib/clang/{17 → 18}/include/cuda_wrappers/bits/basic_string.h +0 -0
- /package/lib/clang/{17 → 18}/include/cuda_wrappers/bits/basic_string.tcc +0 -0
- /package/lib/clang/{17 → 18}/include/cuda_wrappers/bits/shared_ptr_base.h +0 -0
- /package/lib/clang/{17 → 18}/include/cuda_wrappers/cmath +0 -0
- /package/lib/clang/{17 → 18}/include/cuda_wrappers/complex +0 -0
- /package/lib/clang/{17 → 18}/include/cuda_wrappers/new +0 -0
- /package/lib/clang/{17 → 18}/include/enqcmdintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/f16cintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/float.h +0 -0
- /package/lib/clang/{17 → 18}/include/fma4intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/fmaintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/fxsrintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/hexagon_circ_brev_intrinsics.h +0 -0
- /package/lib/clang/{17 → 18}/include/hexagon_protos.h +0 -0
- /package/lib/clang/{17 → 18}/include/hexagon_types.h +0 -0
- /package/lib/clang/{17 → 18}/include/hlsl/hlsl_basic_types.h +0 -0
- /package/lib/clang/{17 → 18}/include/hlsl.h +0 -0
- /package/lib/clang/{17 → 18}/include/hresetintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/htmintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/htmxlintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/hvx_hexagon_protos.h +0 -0
- /package/lib/clang/{17 → 18}/include/inttypes.h +0 -0
- /package/lib/clang/{17 → 18}/include/invpcidintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/iso646.h +0 -0
- /package/lib/clang/{17 → 18}/include/keylockerintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/llvm_libc_wrappers/inttypes.h +0 -0
- /package/lib/clang/{17 → 18}/include/lwpintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/lzcntintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/mm3dnow.h +0 -0
- /package/lib/clang/{17 → 18}/include/mm_malloc.h +0 -0
- /package/lib/clang/{17 → 18}/include/movdirintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/msa.h +0 -0
- /package/lib/clang/{17 → 18}/include/mwaitxintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/nmmintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/opencl-c.h +0 -0
- /package/lib/clang/{17 → 18}/include/openmp_wrappers/__clang_openmp_device_functions.h +0 -0
- /package/lib/clang/{17 → 18}/include/openmp_wrappers/complex +0 -0
- /package/lib/clang/{17 → 18}/include/openmp_wrappers/complex.h +0 -0
- /package/lib/clang/{17 → 18}/include/openmp_wrappers/complex_cmath.h +0 -0
- /package/lib/clang/{17 → 18}/include/openmp_wrappers/math.h +0 -0
- /package/lib/clang/{17 → 18}/include/openmp_wrappers/new +0 -0
- /package/lib/clang/{17 → 18}/include/pconfigintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/pkuintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/popcntintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/bmi2intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/bmiintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/emmintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/immintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/mm_malloc.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/mmintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/pmmintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/tmmintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/x86gprintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/x86intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ppc_wrappers/xmmintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/prfchiintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/prfchwintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/ptwriteintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/raointintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/rdpruintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/rdseedintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/rtmintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/s390intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/serializeintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/sgxintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/sha512intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/shaintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/sifive_vector.h +0 -0
- /package/lib/clang/{17 → 18}/include/sm3intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/sm4intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/stdbool.h +0 -0
- /package/lib/clang/{17 → 18}/include/tbmintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/tgmath.h +0 -0
- /package/lib/clang/{17 → 18}/include/tsxldtrkintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/uintrintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/unwind.h +0 -0
- /package/lib/clang/{17 → 18}/include/vadefs.h +0 -0
- /package/lib/clang/{17 → 18}/include/varargs.h +0 -0
- /package/lib/clang/{17 → 18}/include/velintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/velintrin_approx.h +0 -0
- /package/lib/clang/{17 → 18}/include/velintrin_gen.h +0 -0
- /package/lib/clang/{17 → 18}/include/vpclmulqdqintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/waitpkgintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/wasm_simd128.h +0 -0
- /package/lib/clang/{17 → 18}/include/wbnoinvdintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/wmmintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/x86intrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/xopintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/xsavecintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/xsaveintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/xsaveoptintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/xsavesintrin.h +0 -0
- /package/lib/clang/{17 → 18}/include/xtestintrin.h +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @cpp-linter/clang-tidy-linux-arm64
|
|
2
2
|
|
|
3
|
-
The Linux arm64 binary of clang-tidy from LLVM
|
|
3
|
+
The Linux arm64 binary of clang-tidy from LLVM 18.1.8, for [`@cpp-linter/clang-tidy`](https://www.npmjs.com/package/@cpp-linter/clang-tidy).
|
|
4
4
|
|
|
5
5
|
Install `@cpp-linter/clang-tidy` instead of this package: npm picks the binary for your platform.
|
|
6
6
|
|
|
7
|
-
The binary is a static build from the release [`llvm-
|
|
7
|
+
The binary is a static build from the release [`llvm-18.1.8`](https://github.com/cpp-linter/clang-tools-static-binaries/releases/tag/llvm-18.1.8) of [cpp-linter/clang-tools-static-binaries](https://github.com/cpp-linter/clang-tools-static-binaries). LLVM is licensed under the Apache License v2.0 with LLVM Exceptions (see `LICENSE.TXT`).
|
package/bin/clang-tidy
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bin/clang-tidy
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 67076560 bytes
|
|
4
|
+
sha256: 7a5d0630cb32633b157197370641f3396afab4e8145fa6c85947b15863792619
|
|
@@ -502,8 +502,8 @@ __DEVICE__ unsigned int __pm0(void) { return __nvvm_read_ptx_sreg_pm0(); }
|
|
|
502
502
|
__DEVICE__ unsigned int __pm1(void) { return __nvvm_read_ptx_sreg_pm1(); }
|
|
503
503
|
__DEVICE__ unsigned int __pm2(void) { return __nvvm_read_ptx_sreg_pm2(); }
|
|
504
504
|
__DEVICE__ unsigned int __pm3(void) { return __nvvm_read_ptx_sreg_pm3(); }
|
|
505
|
-
__DEVICE__ int __popc(int __a) { return __nv_popc(__a); }
|
|
506
|
-
__DEVICE__ int __popcll(long long __a) { return __nv_popcll(__a); }
|
|
505
|
+
__DEVICE__ int __popc(unsigned int __a) { return __nv_popc(__a); }
|
|
506
|
+
__DEVICE__ int __popcll(unsigned long long __a) { return __nv_popcll(__a); }
|
|
507
507
|
__DEVICE__ float __powf(float __a, float __b) {
|
|
508
508
|
return __nv_fast_powf(__a, __b);
|
|
509
509
|
}
|
|
@@ -285,8 +285,8 @@ __DEVICE__ double __nv_normcdfinv(double __a);
|
|
|
285
285
|
__DEVICE__ float __nv_normcdfinvf(float __a);
|
|
286
286
|
__DEVICE__ float __nv_normf(int __a, const float *__b);
|
|
287
287
|
__DEVICE__ double __nv_norm(int __a, const double *__b);
|
|
288
|
-
__DEVICE__ int __nv_popc(int __a);
|
|
289
|
-
__DEVICE__ int __nv_popcll(long long __a);
|
|
288
|
+
__DEVICE__ int __nv_popc(unsigned int __a);
|
|
289
|
+
__DEVICE__ int __nv_popcll(unsigned long long __a);
|
|
290
290
|
__DEVICE__ double __nv_pow(double __a, double __b);
|
|
291
291
|
__DEVICE__ float __nv_powf(float __a, float __b);
|
|
292
292
|
__DEVICE__ double __nv_powi(double __a, int __b);
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
// libdevice provides fast low precision and slow full-recision implementations
|
|
46
46
|
// for some functions. Which one gets selected depends on
|
|
47
47
|
// __CLANG_CUDA_APPROX_TRANSCENDENTALS__ which gets defined by clang if
|
|
48
|
-
// -ffast-math or -
|
|
48
|
+
// -ffast-math or -fgpu-approx-transcendentals are in effect.
|
|
49
49
|
#pragma push_macro("__FAST_OR_SLOW")
|
|
50
|
-
#if defined(
|
|
50
|
+
#if defined(__CLANG_GPU_APPROX_TRANSCENDENTALS__)
|
|
51
51
|
#define __FAST_OR_SLOW(fast, slow) fast
|
|
52
52
|
#else
|
|
53
53
|
#define __FAST_OR_SLOW(fast, slow) slow
|
|
@@ -196,12 +196,12 @@ inline __host__ double __signbitd(double x) {
|
|
|
196
196
|
|
|
197
197
|
// math_function.hpp uses the __USE_FAST_MATH__ macro to determine whether we
|
|
198
198
|
// get the slow-but-accurate or fast-but-inaccurate versions of functions like
|
|
199
|
-
// sin and exp. This is controlled in clang by -
|
|
199
|
+
// sin and exp. This is controlled in clang by -fgpu-approx-transcendentals.
|
|
200
200
|
//
|
|
201
201
|
// device_functions.hpp uses __USE_FAST_MATH__ for a different purpose (fast vs.
|
|
202
202
|
// slow divides), so we need to scope our define carefully here.
|
|
203
203
|
#pragma push_macro("__USE_FAST_MATH__")
|
|
204
|
-
#if defined(
|
|
204
|
+
#if defined(__CLANG_GPU_APPROX_TRANSCENDENTALS__)
|
|
205
205
|
#define __USE_FAST_MATH__ 1
|
|
206
206
|
#endif
|
|
207
207
|
|
|
@@ -14,9 +14,6 @@
|
|
|
14
14
|
#endif
|
|
15
15
|
|
|
16
16
|
#if !defined(__HIPCC_RTC__)
|
|
17
|
-
#if defined(__cplusplus)
|
|
18
|
-
#include <algorithm>
|
|
19
|
-
#endif
|
|
20
17
|
#include <limits.h>
|
|
21
18
|
#include <stdint.h>
|
|
22
19
|
#ifdef __OPENMP_AMDGCN__
|
|
@@ -32,6 +29,17 @@
|
|
|
32
29
|
#define __DEVICE__ static __device__ inline __attribute__((always_inline))
|
|
33
30
|
#endif
|
|
34
31
|
|
|
32
|
+
// Device library provides fast low precision and slow full-recision
|
|
33
|
+
// implementations for some functions. Which one gets selected depends on
|
|
34
|
+
// __CLANG_GPU_APPROX_TRANSCENDENTALS__ which gets defined by clang if
|
|
35
|
+
// -ffast-math or -fgpu-approx-transcendentals are in effect.
|
|
36
|
+
#pragma push_macro("__FAST_OR_SLOW")
|
|
37
|
+
#if defined(__CLANG_GPU_APPROX_TRANSCENDENTALS__)
|
|
38
|
+
#define __FAST_OR_SLOW(fast, slow) fast
|
|
39
|
+
#else
|
|
40
|
+
#define __FAST_OR_SLOW(fast, slow) slow
|
|
41
|
+
#endif
|
|
42
|
+
|
|
35
43
|
// A few functions return bool type starting only in C++11.
|
|
36
44
|
#pragma push_macro("__RETURN_TYPE")
|
|
37
45
|
#ifdef __OPENMP_AMDGCN__
|
|
@@ -139,21 +147,180 @@ uint64_t __make_mantissa(const char *__tagp __attribute__((nonnull))) {
|
|
|
139
147
|
}
|
|
140
148
|
|
|
141
149
|
// BEGIN FLOAT
|
|
150
|
+
|
|
151
|
+
// BEGIN INTRINSICS
|
|
152
|
+
|
|
153
|
+
__DEVICE__
|
|
154
|
+
float __cosf(float __x) { return __ocml_native_cos_f32(__x); }
|
|
155
|
+
|
|
156
|
+
__DEVICE__
|
|
157
|
+
float __exp10f(float __x) {
|
|
158
|
+
const float __log2_10 = 0x1.a934f0p+1f;
|
|
159
|
+
return __builtin_amdgcn_exp2f(__log2_10 * __x);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
__DEVICE__
|
|
163
|
+
float __expf(float __x) {
|
|
164
|
+
const float __log2_e = 0x1.715476p+0;
|
|
165
|
+
return __builtin_amdgcn_exp2f(__log2_e * __x);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
169
|
+
__DEVICE__
|
|
170
|
+
float __fadd_rd(float __x, float __y) { return __ocml_add_rtn_f32(__x, __y); }
|
|
171
|
+
__DEVICE__
|
|
172
|
+
float __fadd_rn(float __x, float __y) { return __ocml_add_rte_f32(__x, __y); }
|
|
173
|
+
__DEVICE__
|
|
174
|
+
float __fadd_ru(float __x, float __y) { return __ocml_add_rtp_f32(__x, __y); }
|
|
175
|
+
__DEVICE__
|
|
176
|
+
float __fadd_rz(float __x, float __y) { return __ocml_add_rtz_f32(__x, __y); }
|
|
177
|
+
#else
|
|
178
|
+
__DEVICE__
|
|
179
|
+
float __fadd_rn(float __x, float __y) { return __x + __y; }
|
|
180
|
+
#endif
|
|
181
|
+
|
|
182
|
+
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
183
|
+
__DEVICE__
|
|
184
|
+
float __fdiv_rd(float __x, float __y) { return __ocml_div_rtn_f32(__x, __y); }
|
|
185
|
+
__DEVICE__
|
|
186
|
+
float __fdiv_rn(float __x, float __y) { return __ocml_div_rte_f32(__x, __y); }
|
|
187
|
+
__DEVICE__
|
|
188
|
+
float __fdiv_ru(float __x, float __y) { return __ocml_div_rtp_f32(__x, __y); }
|
|
189
|
+
__DEVICE__
|
|
190
|
+
float __fdiv_rz(float __x, float __y) { return __ocml_div_rtz_f32(__x, __y); }
|
|
191
|
+
#else
|
|
192
|
+
__DEVICE__
|
|
193
|
+
float __fdiv_rn(float __x, float __y) { return __x / __y; }
|
|
194
|
+
#endif
|
|
195
|
+
|
|
196
|
+
__DEVICE__
|
|
197
|
+
float __fdividef(float __x, float __y) { return __x / __y; }
|
|
198
|
+
|
|
199
|
+
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
200
|
+
__DEVICE__
|
|
201
|
+
float __fmaf_rd(float __x, float __y, float __z) {
|
|
202
|
+
return __ocml_fma_rtn_f32(__x, __y, __z);
|
|
203
|
+
}
|
|
204
|
+
__DEVICE__
|
|
205
|
+
float __fmaf_rn(float __x, float __y, float __z) {
|
|
206
|
+
return __ocml_fma_rte_f32(__x, __y, __z);
|
|
207
|
+
}
|
|
208
|
+
__DEVICE__
|
|
209
|
+
float __fmaf_ru(float __x, float __y, float __z) {
|
|
210
|
+
return __ocml_fma_rtp_f32(__x, __y, __z);
|
|
211
|
+
}
|
|
212
|
+
__DEVICE__
|
|
213
|
+
float __fmaf_rz(float __x, float __y, float __z) {
|
|
214
|
+
return __ocml_fma_rtz_f32(__x, __y, __z);
|
|
215
|
+
}
|
|
216
|
+
#else
|
|
217
|
+
__DEVICE__
|
|
218
|
+
float __fmaf_rn(float __x, float __y, float __z) {
|
|
219
|
+
return __builtin_fmaf(__x, __y, __z);
|
|
220
|
+
}
|
|
221
|
+
#endif
|
|
222
|
+
|
|
223
|
+
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
224
|
+
__DEVICE__
|
|
225
|
+
float __fmul_rd(float __x, float __y) { return __ocml_mul_rtn_f32(__x, __y); }
|
|
226
|
+
__DEVICE__
|
|
227
|
+
float __fmul_rn(float __x, float __y) { return __ocml_mul_rte_f32(__x, __y); }
|
|
228
|
+
__DEVICE__
|
|
229
|
+
float __fmul_ru(float __x, float __y) { return __ocml_mul_rtp_f32(__x, __y); }
|
|
230
|
+
__DEVICE__
|
|
231
|
+
float __fmul_rz(float __x, float __y) { return __ocml_mul_rtz_f32(__x, __y); }
|
|
232
|
+
#else
|
|
233
|
+
__DEVICE__
|
|
234
|
+
float __fmul_rn(float __x, float __y) { return __x * __y; }
|
|
235
|
+
#endif
|
|
236
|
+
|
|
237
|
+
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
238
|
+
__DEVICE__
|
|
239
|
+
float __frcp_rd(float __x) { return __ocml_div_rtn_f32(1.0f, __x); }
|
|
240
|
+
__DEVICE__
|
|
241
|
+
float __frcp_rn(float __x) { return __ocml_div_rte_f32(1.0f, __x); }
|
|
242
|
+
__DEVICE__
|
|
243
|
+
float __frcp_ru(float __x) { return __ocml_div_rtp_f32(1.0f, __x); }
|
|
244
|
+
__DEVICE__
|
|
245
|
+
float __frcp_rz(float __x) { return __ocml_div_rtz_f32(1.0f, __x); }
|
|
246
|
+
#else
|
|
247
|
+
__DEVICE__
|
|
248
|
+
float __frcp_rn(float __x) { return 1.0f / __x; }
|
|
249
|
+
#endif
|
|
250
|
+
|
|
251
|
+
__DEVICE__
|
|
252
|
+
float __frsqrt_rn(float __x) { return __builtin_amdgcn_rsqf(__x); }
|
|
253
|
+
|
|
254
|
+
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
255
|
+
__DEVICE__
|
|
256
|
+
float __fsqrt_rd(float __x) { return __ocml_sqrt_rtn_f32(__x); }
|
|
257
|
+
__DEVICE__
|
|
258
|
+
float __fsqrt_rn(float __x) { return __ocml_sqrt_rte_f32(__x); }
|
|
259
|
+
__DEVICE__
|
|
260
|
+
float __fsqrt_ru(float __x) { return __ocml_sqrt_rtp_f32(__x); }
|
|
261
|
+
__DEVICE__
|
|
262
|
+
float __fsqrt_rz(float __x) { return __ocml_sqrt_rtz_f32(__x); }
|
|
263
|
+
#else
|
|
264
|
+
__DEVICE__
|
|
265
|
+
float __fsqrt_rn(float __x) { return __ocml_native_sqrt_f32(__x); }
|
|
266
|
+
#endif
|
|
267
|
+
|
|
268
|
+
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
269
|
+
__DEVICE__
|
|
270
|
+
float __fsub_rd(float __x, float __y) { return __ocml_sub_rtn_f32(__x, __y); }
|
|
271
|
+
__DEVICE__
|
|
272
|
+
float __fsub_rn(float __x, float __y) { return __ocml_sub_rte_f32(__x, __y); }
|
|
273
|
+
__DEVICE__
|
|
274
|
+
float __fsub_ru(float __x, float __y) { return __ocml_sub_rtp_f32(__x, __y); }
|
|
275
|
+
__DEVICE__
|
|
276
|
+
float __fsub_rz(float __x, float __y) { return __ocml_sub_rtz_f32(__x, __y); }
|
|
277
|
+
#else
|
|
278
|
+
__DEVICE__
|
|
279
|
+
float __fsub_rn(float __x, float __y) { return __x - __y; }
|
|
280
|
+
#endif
|
|
281
|
+
|
|
282
|
+
__DEVICE__
|
|
283
|
+
float __log10f(float __x) { return __builtin_log10f(__x); }
|
|
284
|
+
|
|
285
|
+
__DEVICE__
|
|
286
|
+
float __log2f(float __x) { return __builtin_amdgcn_logf(__x); }
|
|
287
|
+
|
|
288
|
+
__DEVICE__
|
|
289
|
+
float __logf(float __x) { return __builtin_logf(__x); }
|
|
290
|
+
|
|
291
|
+
__DEVICE__
|
|
292
|
+
float __powf(float __x, float __y) { return __ocml_pow_f32(__x, __y); }
|
|
293
|
+
|
|
294
|
+
__DEVICE__
|
|
295
|
+
float __saturatef(float __x) { return (__x < 0) ? 0 : ((__x > 1) ? 1 : __x); }
|
|
296
|
+
|
|
297
|
+
__DEVICE__
|
|
298
|
+
void __sincosf(float __x, float *__sinptr, float *__cosptr) {
|
|
299
|
+
*__sinptr = __ocml_native_sin_f32(__x);
|
|
300
|
+
*__cosptr = __ocml_native_cos_f32(__x);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
__DEVICE__
|
|
304
|
+
float __sinf(float __x) { return __ocml_native_sin_f32(__x); }
|
|
305
|
+
|
|
306
|
+
__DEVICE__
|
|
307
|
+
float __tanf(float __x) {
|
|
308
|
+
return __sinf(__x) * __builtin_amdgcn_rcpf(__cosf(__x));
|
|
309
|
+
}
|
|
310
|
+
// END INTRINSICS
|
|
311
|
+
|
|
142
312
|
#if defined(__cplusplus)
|
|
143
313
|
__DEVICE__
|
|
144
314
|
int abs(int __x) {
|
|
145
|
-
|
|
146
|
-
return (__x ^ __sgn) - __sgn;
|
|
315
|
+
return __builtin_abs(__x);
|
|
147
316
|
}
|
|
148
317
|
__DEVICE__
|
|
149
318
|
long labs(long __x) {
|
|
150
|
-
|
|
151
|
-
return (__x ^ __sgn) - __sgn;
|
|
319
|
+
return __builtin_labs(__x);
|
|
152
320
|
}
|
|
153
321
|
__DEVICE__
|
|
154
322
|
long long llabs(long long __x) {
|
|
155
|
-
|
|
156
|
-
return (__x ^ __sgn) - __sgn;
|
|
323
|
+
return __builtin_llabs(__x);
|
|
157
324
|
}
|
|
158
325
|
#endif
|
|
159
326
|
|
|
@@ -188,7 +355,7 @@ __DEVICE__
|
|
|
188
355
|
float copysignf(float __x, float __y) { return __builtin_copysignf(__x, __y); }
|
|
189
356
|
|
|
190
357
|
__DEVICE__
|
|
191
|
-
float cosf(float __x) { return __ocml_cos_f32(__x); }
|
|
358
|
+
float cosf(float __x) { return __FAST_OR_SLOW(__cosf, __ocml_cos_f32)(__x); }
|
|
192
359
|
|
|
193
360
|
__DEVICE__
|
|
194
361
|
float coshf(float __x) { return __ocml_cosh_f32(__x); }
|
|
@@ -321,13 +488,13 @@ __DEVICE__
|
|
|
321
488
|
float log1pf(float __x) { return __ocml_log1p_f32(__x); }
|
|
322
489
|
|
|
323
490
|
__DEVICE__
|
|
324
|
-
float log2f(float __x) { return
|
|
491
|
+
float log2f(float __x) { return __FAST_OR_SLOW(__log2f, __ocml_log2_f32)(__x); }
|
|
325
492
|
|
|
326
493
|
__DEVICE__
|
|
327
494
|
float logbf(float __x) { return __ocml_logb_f32(__x); }
|
|
328
495
|
|
|
329
496
|
__DEVICE__
|
|
330
|
-
float logf(float __x) { return
|
|
497
|
+
float logf(float __x) { return __FAST_OR_SLOW(__logf, __ocml_log_f32)(__x); }
|
|
331
498
|
|
|
332
499
|
__DEVICE__
|
|
333
500
|
long int lrintf(float __x) { return __builtin_rintf(__x); }
|
|
@@ -401,7 +568,7 @@ float normf(int __dim,
|
|
|
401
568
|
++__a;
|
|
402
569
|
}
|
|
403
570
|
|
|
404
|
-
return
|
|
571
|
+
return __builtin_sqrtf(__r);
|
|
405
572
|
}
|
|
406
573
|
|
|
407
574
|
__DEVICE__
|
|
@@ -483,9 +650,13 @@ void sincosf(float __x, float *__sinptr, float *__cosptr) {
|
|
|
483
650
|
#ifdef __OPENMP_AMDGCN__
|
|
484
651
|
#pragma omp allocate(__tmp) allocator(omp_thread_mem_alloc)
|
|
485
652
|
#endif
|
|
653
|
+
#ifdef __CLANG_CUDA_APPROX_TRANSCENDENTALS__
|
|
654
|
+
__sincosf(__x, __sinptr, __cosptr);
|
|
655
|
+
#else
|
|
486
656
|
*__sinptr =
|
|
487
657
|
__ocml_sincos_f32(__x, (__attribute__((address_space(5))) float *)&__tmp);
|
|
488
658
|
*__cosptr = __tmp;
|
|
659
|
+
#endif
|
|
489
660
|
}
|
|
490
661
|
|
|
491
662
|
__DEVICE__
|
|
@@ -500,7 +671,7 @@ void sincospif(float __x, float *__sinptr, float *__cosptr) {
|
|
|
500
671
|
}
|
|
501
672
|
|
|
502
673
|
__DEVICE__
|
|
503
|
-
float sinf(float __x) { return __ocml_sin_f32(__x); }
|
|
674
|
+
float sinf(float __x) { return __FAST_OR_SLOW(__sinf, __ocml_sin_f32)(__x); }
|
|
504
675
|
|
|
505
676
|
__DEVICE__
|
|
506
677
|
float sinhf(float __x) { return __ocml_sinh_f32(__x); }
|
|
@@ -509,7 +680,7 @@ __DEVICE__
|
|
|
509
680
|
float sinpif(float __x) { return __ocml_sinpi_f32(__x); }
|
|
510
681
|
|
|
511
682
|
__DEVICE__
|
|
512
|
-
float sqrtf(float __x) { return
|
|
683
|
+
float sqrtf(float __x) { return __builtin_sqrtf(__x); }
|
|
513
684
|
|
|
514
685
|
__DEVICE__
|
|
515
686
|
float tanf(float __x) { return __ocml_tan_f32(__x); }
|
|
@@ -551,158 +722,7 @@ float ynf(int __n, float __x) { // TODO: we could use Ahmes multiplication
|
|
|
551
722
|
return __x1;
|
|
552
723
|
}
|
|
553
724
|
|
|
554
|
-
// BEGIN INTRINSICS
|
|
555
|
-
|
|
556
|
-
__DEVICE__
|
|
557
|
-
float __cosf(float __x) { return __ocml_native_cos_f32(__x); }
|
|
558
|
-
|
|
559
|
-
__DEVICE__
|
|
560
|
-
float __exp10f(float __x) { return __ocml_native_exp10_f32(__x); }
|
|
561
|
-
|
|
562
|
-
__DEVICE__
|
|
563
|
-
float __expf(float __x) { return __ocml_native_exp_f32(__x); }
|
|
564
|
-
|
|
565
|
-
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
566
|
-
__DEVICE__
|
|
567
|
-
float __fadd_rd(float __x, float __y) { return __ocml_add_rtn_f32(__x, __y); }
|
|
568
|
-
__DEVICE__
|
|
569
|
-
float __fadd_rn(float __x, float __y) { return __ocml_add_rte_f32(__x, __y); }
|
|
570
|
-
__DEVICE__
|
|
571
|
-
float __fadd_ru(float __x, float __y) { return __ocml_add_rtp_f32(__x, __y); }
|
|
572
|
-
__DEVICE__
|
|
573
|
-
float __fadd_rz(float __x, float __y) { return __ocml_add_rtz_f32(__x, __y); }
|
|
574
|
-
#else
|
|
575
|
-
__DEVICE__
|
|
576
|
-
float __fadd_rn(float __x, float __y) { return __x + __y; }
|
|
577
|
-
#endif
|
|
578
|
-
|
|
579
|
-
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
580
|
-
__DEVICE__
|
|
581
|
-
float __fdiv_rd(float __x, float __y) { return __ocml_div_rtn_f32(__x, __y); }
|
|
582
|
-
__DEVICE__
|
|
583
|
-
float __fdiv_rn(float __x, float __y) { return __ocml_div_rte_f32(__x, __y); }
|
|
584
|
-
__DEVICE__
|
|
585
|
-
float __fdiv_ru(float __x, float __y) { return __ocml_div_rtp_f32(__x, __y); }
|
|
586
|
-
__DEVICE__
|
|
587
|
-
float __fdiv_rz(float __x, float __y) { return __ocml_div_rtz_f32(__x, __y); }
|
|
588
|
-
#else
|
|
589
|
-
__DEVICE__
|
|
590
|
-
float __fdiv_rn(float __x, float __y) { return __x / __y; }
|
|
591
|
-
#endif
|
|
592
|
-
|
|
593
|
-
__DEVICE__
|
|
594
|
-
float __fdividef(float __x, float __y) { return __x / __y; }
|
|
595
|
-
|
|
596
|
-
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
597
|
-
__DEVICE__
|
|
598
|
-
float __fmaf_rd(float __x, float __y, float __z) {
|
|
599
|
-
return __ocml_fma_rtn_f32(__x, __y, __z);
|
|
600
|
-
}
|
|
601
|
-
__DEVICE__
|
|
602
|
-
float __fmaf_rn(float __x, float __y, float __z) {
|
|
603
|
-
return __ocml_fma_rte_f32(__x, __y, __z);
|
|
604
|
-
}
|
|
605
|
-
__DEVICE__
|
|
606
|
-
float __fmaf_ru(float __x, float __y, float __z) {
|
|
607
|
-
return __ocml_fma_rtp_f32(__x, __y, __z);
|
|
608
|
-
}
|
|
609
|
-
__DEVICE__
|
|
610
|
-
float __fmaf_rz(float __x, float __y, float __z) {
|
|
611
|
-
return __ocml_fma_rtz_f32(__x, __y, __z);
|
|
612
|
-
}
|
|
613
|
-
#else
|
|
614
|
-
__DEVICE__
|
|
615
|
-
float __fmaf_rn(float __x, float __y, float __z) {
|
|
616
|
-
return __builtin_fmaf(__x, __y, __z);
|
|
617
|
-
}
|
|
618
|
-
#endif
|
|
619
725
|
|
|
620
|
-
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
621
|
-
__DEVICE__
|
|
622
|
-
float __fmul_rd(float __x, float __y) { return __ocml_mul_rtn_f32(__x, __y); }
|
|
623
|
-
__DEVICE__
|
|
624
|
-
float __fmul_rn(float __x, float __y) { return __ocml_mul_rte_f32(__x, __y); }
|
|
625
|
-
__DEVICE__
|
|
626
|
-
float __fmul_ru(float __x, float __y) { return __ocml_mul_rtp_f32(__x, __y); }
|
|
627
|
-
__DEVICE__
|
|
628
|
-
float __fmul_rz(float __x, float __y) { return __ocml_mul_rtz_f32(__x, __y); }
|
|
629
|
-
#else
|
|
630
|
-
__DEVICE__
|
|
631
|
-
float __fmul_rn(float __x, float __y) { return __x * __y; }
|
|
632
|
-
#endif
|
|
633
|
-
|
|
634
|
-
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
635
|
-
__DEVICE__
|
|
636
|
-
float __frcp_rd(float __x) { return __ocml_div_rtn_f32(1.0f, __x); }
|
|
637
|
-
__DEVICE__
|
|
638
|
-
float __frcp_rn(float __x) { return __ocml_div_rte_f32(1.0f, __x); }
|
|
639
|
-
__DEVICE__
|
|
640
|
-
float __frcp_ru(float __x) { return __ocml_div_rtp_f32(1.0f, __x); }
|
|
641
|
-
__DEVICE__
|
|
642
|
-
float __frcp_rz(float __x) { return __ocml_div_rtz_f32(1.0f, __x); }
|
|
643
|
-
#else
|
|
644
|
-
__DEVICE__
|
|
645
|
-
float __frcp_rn(float __x) { return 1.0f / __x; }
|
|
646
|
-
#endif
|
|
647
|
-
|
|
648
|
-
__DEVICE__
|
|
649
|
-
float __frsqrt_rn(float __x) { return __builtin_amdgcn_rsqf(__x); }
|
|
650
|
-
|
|
651
|
-
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
652
|
-
__DEVICE__
|
|
653
|
-
float __fsqrt_rd(float __x) { return __ocml_sqrt_rtn_f32(__x); }
|
|
654
|
-
__DEVICE__
|
|
655
|
-
float __fsqrt_rn(float __x) { return __ocml_sqrt_rte_f32(__x); }
|
|
656
|
-
__DEVICE__
|
|
657
|
-
float __fsqrt_ru(float __x) { return __ocml_sqrt_rtp_f32(__x); }
|
|
658
|
-
__DEVICE__
|
|
659
|
-
float __fsqrt_rz(float __x) { return __ocml_sqrt_rtz_f32(__x); }
|
|
660
|
-
#else
|
|
661
|
-
__DEVICE__
|
|
662
|
-
float __fsqrt_rn(float __x) { return __ocml_native_sqrt_f32(__x); }
|
|
663
|
-
#endif
|
|
664
|
-
|
|
665
|
-
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
666
|
-
__DEVICE__
|
|
667
|
-
float __fsub_rd(float __x, float __y) { return __ocml_sub_rtn_f32(__x, __y); }
|
|
668
|
-
__DEVICE__
|
|
669
|
-
float __fsub_rn(float __x, float __y) { return __ocml_sub_rte_f32(__x, __y); }
|
|
670
|
-
__DEVICE__
|
|
671
|
-
float __fsub_ru(float __x, float __y) { return __ocml_sub_rtp_f32(__x, __y); }
|
|
672
|
-
__DEVICE__
|
|
673
|
-
float __fsub_rz(float __x, float __y) { return __ocml_sub_rtz_f32(__x, __y); }
|
|
674
|
-
#else
|
|
675
|
-
__DEVICE__
|
|
676
|
-
float __fsub_rn(float __x, float __y) { return __x - __y; }
|
|
677
|
-
#endif
|
|
678
|
-
|
|
679
|
-
__DEVICE__
|
|
680
|
-
float __log10f(float __x) { return __ocml_native_log10_f32(__x); }
|
|
681
|
-
|
|
682
|
-
__DEVICE__
|
|
683
|
-
float __log2f(float __x) { return __ocml_native_log2_f32(__x); }
|
|
684
|
-
|
|
685
|
-
__DEVICE__
|
|
686
|
-
float __logf(float __x) { return __ocml_native_log_f32(__x); }
|
|
687
|
-
|
|
688
|
-
__DEVICE__
|
|
689
|
-
float __powf(float __x, float __y) { return __ocml_pow_f32(__x, __y); }
|
|
690
|
-
|
|
691
|
-
__DEVICE__
|
|
692
|
-
float __saturatef(float __x) { return (__x < 0) ? 0 : ((__x > 1) ? 1 : __x); }
|
|
693
|
-
|
|
694
|
-
__DEVICE__
|
|
695
|
-
void __sincosf(float __x, float *__sinptr, float *__cosptr) {
|
|
696
|
-
*__sinptr = __ocml_native_sin_f32(__x);
|
|
697
|
-
*__cosptr = __ocml_native_cos_f32(__x);
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
__DEVICE__
|
|
701
|
-
float __sinf(float __x) { return __ocml_native_sin_f32(__x); }
|
|
702
|
-
|
|
703
|
-
__DEVICE__
|
|
704
|
-
float __tanf(float __x) { return __ocml_tan_f32(__x); }
|
|
705
|
-
// END INTRINSICS
|
|
706
726
|
// END FLOAT
|
|
707
727
|
|
|
708
728
|
// BEGIN DOUBLE
|
|
@@ -941,7 +961,7 @@ double norm(int __dim,
|
|
|
941
961
|
++__a;
|
|
942
962
|
}
|
|
943
963
|
|
|
944
|
-
return
|
|
964
|
+
return __builtin_sqrt(__r);
|
|
945
965
|
}
|
|
946
966
|
|
|
947
967
|
__DEVICE__
|
|
@@ -1064,7 +1084,7 @@ __DEVICE__
|
|
|
1064
1084
|
double sinpi(double __x) { return __ocml_sinpi_f64(__x); }
|
|
1065
1085
|
|
|
1066
1086
|
__DEVICE__
|
|
1067
|
-
double sqrt(double __x) { return
|
|
1087
|
+
double sqrt(double __x) { return __builtin_sqrt(__x); }
|
|
1068
1088
|
|
|
1069
1089
|
__DEVICE__
|
|
1070
1090
|
double tan(double __x) { return __ocml_tan_f64(__x); }
|
|
@@ -1198,7 +1218,7 @@ __DEVICE__
|
|
|
1198
1218
|
double __dsqrt_rz(double __x) { return __ocml_sqrt_rtz_f64(__x); }
|
|
1199
1219
|
#else
|
|
1200
1220
|
__DEVICE__
|
|
1201
|
-
double __dsqrt_rn(double __x) { return
|
|
1221
|
+
double __dsqrt_rn(double __x) { return __builtin_sqrt(__x); }
|
|
1202
1222
|
#endif
|
|
1203
1223
|
|
|
1204
1224
|
#if defined OCML_BASIC_ROUNDED_OPERATIONS
|
|
@@ -1288,16 +1308,17 @@ double min(double __x, double __y) { return __builtin_fmin(__x, __y); }
|
|
|
1288
1308
|
|
|
1289
1309
|
#if !defined(__HIPCC_RTC__) && !defined(__OPENMP_AMDGCN__)
|
|
1290
1310
|
__host__ inline static int min(int __arg1, int __arg2) {
|
|
1291
|
-
return
|
|
1311
|
+
return __arg1 < __arg2 ? __arg1 : __arg2;
|
|
1292
1312
|
}
|
|
1293
1313
|
|
|
1294
1314
|
__host__ inline static int max(int __arg1, int __arg2) {
|
|
1295
|
-
return
|
|
1315
|
+
return __arg1 > __arg2 ? __arg1 : __arg2;
|
|
1296
1316
|
}
|
|
1297
1317
|
#endif // !defined(__HIPCC_RTC__) && !defined(__OPENMP_AMDGCN__)
|
|
1298
1318
|
#endif
|
|
1299
1319
|
|
|
1300
1320
|
#pragma pop_macro("__DEVICE__")
|
|
1301
1321
|
#pragma pop_macro("__RETURN_TYPE")
|
|
1322
|
+
#pragma pop_macro("__FAST_OR_SLOW")
|
|
1302
1323
|
|
|
1303
1324
|
#endif // __CLANG_HIP_MATH_H__
|
|
@@ -47,28 +47,9 @@ extern "C" {
|
|
|
47
47
|
#endif //__cplusplus
|
|
48
48
|
|
|
49
49
|
#if !defined(__HIPCC_RTC__)
|
|
50
|
-
#include <cmath>
|
|
51
|
-
#include <cstdlib>
|
|
52
|
-
#include <stdlib.h>
|
|
53
50
|
#if __has_include("hip/hip_version.h")
|
|
54
51
|
#include "hip/hip_version.h"
|
|
55
52
|
#endif // __has_include("hip/hip_version.h")
|
|
56
|
-
#else
|
|
57
|
-
typedef __SIZE_TYPE__ size_t;
|
|
58
|
-
// Define macros which are needed to declare HIP device API's without standard
|
|
59
|
-
// C/C++ headers. This is for readability so that these API's can be written
|
|
60
|
-
// the same way as non-hipRTC use case. These macros need to be popped so that
|
|
61
|
-
// they do not pollute users' name space.
|
|
62
|
-
#pragma push_macro("NULL")
|
|
63
|
-
#pragma push_macro("uint32_t")
|
|
64
|
-
#pragma push_macro("uint64_t")
|
|
65
|
-
#pragma push_macro("CHAR_BIT")
|
|
66
|
-
#pragma push_macro("INT_MAX")
|
|
67
|
-
#define NULL (void *)0
|
|
68
|
-
#define uint32_t __UINT32_TYPE__
|
|
69
|
-
#define uint64_t __UINT64_TYPE__
|
|
70
|
-
#define CHAR_BIT __CHAR_BIT__
|
|
71
|
-
#define INT_MAX __INTMAX_MAX__
|
|
72
53
|
#endif // __HIPCC_RTC__
|
|
73
54
|
|
|
74
55
|
typedef __SIZE_TYPE__ __hip_size_t;
|
|
@@ -78,11 +59,13 @@ extern "C" {
|
|
|
78
59
|
#endif //__cplusplus
|
|
79
60
|
|
|
80
61
|
#if HIP_VERSION_MAJOR * 100 + HIP_VERSION_MINOR >= 405
|
|
81
|
-
|
|
82
|
-
|
|
62
|
+
__device__ unsigned long long __ockl_dm_alloc(unsigned long long __size);
|
|
63
|
+
__device__ void __ockl_dm_dealloc(unsigned long long __addr);
|
|
83
64
|
#if __has_feature(address_sanitizer)
|
|
84
|
-
|
|
85
|
-
|
|
65
|
+
__device__ unsigned long long __asan_malloc_impl(unsigned long long __size,
|
|
66
|
+
unsigned long long __pc);
|
|
67
|
+
__device__ void __asan_free_impl(unsigned long long __addr,
|
|
68
|
+
unsigned long long __pc);
|
|
86
69
|
__attribute__((noinline, weak)) __device__ void *malloc(__hip_size_t __size) {
|
|
87
70
|
unsigned long long __pc = (unsigned long long)__builtin_return_address(0);
|
|
88
71
|
return (void *)__asan_malloc_impl(__size, __pc);
|
|
@@ -91,7 +74,7 @@ __attribute__((noinline, weak)) __device__ void free(void *__ptr) {
|
|
|
91
74
|
unsigned long long __pc = (unsigned long long)__builtin_return_address(0);
|
|
92
75
|
__asan_free_impl((unsigned long long)__ptr, __pc);
|
|
93
76
|
}
|
|
94
|
-
#else
|
|
77
|
+
#else // __has_feature(address_sanitizer)
|
|
95
78
|
__attribute__((weak)) inline __device__ void *malloc(__hip_size_t __size) {
|
|
96
79
|
return (void *) __ockl_dm_alloc(__size);
|
|
97
80
|
}
|
|
@@ -109,7 +92,7 @@ __attribute__((weak)) inline __device__ void *malloc(__hip_size_t __size) {
|
|
|
109
92
|
__attribute__((weak)) inline __device__ void free(void *__ptr) {
|
|
110
93
|
__hip_free(__ptr);
|
|
111
94
|
}
|
|
112
|
-
#else
|
|
95
|
+
#else // __HIP_ENABLE_DEVICE_MALLOC__
|
|
113
96
|
__attribute__((weak)) inline __device__ void *malloc(__hip_size_t __size) {
|
|
114
97
|
__builtin_trap();
|
|
115
98
|
return (void *)0;
|
|
@@ -117,13 +100,38 @@ __attribute__((weak)) inline __device__ void *malloc(__hip_size_t __size) {
|
|
|
117
100
|
__attribute__((weak)) inline __device__ void free(void *__ptr) {
|
|
118
101
|
__builtin_trap();
|
|
119
102
|
}
|
|
120
|
-
#endif
|
|
103
|
+
#endif // __HIP_ENABLE_DEVICE_MALLOC__
|
|
121
104
|
#endif // HIP version check
|
|
122
105
|
|
|
123
106
|
#ifdef __cplusplus
|
|
124
107
|
} // extern "C"
|
|
125
108
|
#endif //__cplusplus
|
|
126
109
|
|
|
110
|
+
#if !defined(__HIPCC_RTC__)
|
|
111
|
+
#include <cmath>
|
|
112
|
+
#include <cstdlib>
|
|
113
|
+
#include <stdlib.h>
|
|
114
|
+
#if __has_include("hip/hip_version.h")
|
|
115
|
+
#include "hip/hip_version.h"
|
|
116
|
+
#endif // __has_include("hip/hip_version.h")
|
|
117
|
+
#else
|
|
118
|
+
typedef __SIZE_TYPE__ size_t;
|
|
119
|
+
// Define macros which are needed to declare HIP device API's without standard
|
|
120
|
+
// C/C++ headers. This is for readability so that these API's can be written
|
|
121
|
+
// the same way as non-hipRTC use case. These macros need to be popped so that
|
|
122
|
+
// they do not pollute users' name space.
|
|
123
|
+
#pragma push_macro("NULL")
|
|
124
|
+
#pragma push_macro("uint32_t")
|
|
125
|
+
#pragma push_macro("uint64_t")
|
|
126
|
+
#pragma push_macro("CHAR_BIT")
|
|
127
|
+
#pragma push_macro("INT_MAX")
|
|
128
|
+
#define NULL (void *)0
|
|
129
|
+
#define uint32_t __UINT32_TYPE__
|
|
130
|
+
#define uint64_t __UINT64_TYPE__
|
|
131
|
+
#define CHAR_BIT __CHAR_BIT__
|
|
132
|
+
#define INT_MAX __INTMAX_MAX__
|
|
133
|
+
#endif // __HIPCC_RTC__
|
|
134
|
+
|
|
127
135
|
#include <__clang_hip_libdevice_declares.h>
|
|
128
136
|
#include <__clang_hip_math.h>
|
|
129
137
|
#include <__clang_hip_stdlib.h>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*===---- __stdarg___gnuc_va_list.h - Definition of __gnuc_va_list ---------===
|
|
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 __GNUC_VA_LIST
|
|
11
|
+
#define __GNUC_VA_LIST
|
|
12
|
+
typedef __builtin_va_list __gnuc_va_list;
|
|
13
|
+
#endif
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*===---- __stdarg___va_copy.h - Definition of __va_copy -------------------===
|
|
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 __va_copy
|
|
11
|
+
#define __va_copy(d, s) __builtin_va_copy(d, s)
|
|
12
|
+
#endif
|