@cpp-linter/clang-tidy-win32-x64 12.0.1 → 13.0.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.
- package/README.md +2 -2
- package/bin/clang-tidy.exe +2 -2
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_device_functions.h +174 -102
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_runtime_wrapper.h +6 -1
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_hip_cmath.h +272 -94
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_hip_libdevice_declares.h +24 -12
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_hip_math.h +48 -2
- package/lib/clang/13.0.0/include/__clang_hip_runtime_wrapper.h +124 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/altivec.h +1165 -423
- package/lib/clang/{12.0.1 → 13.0.0}/include/amxintrin.h +234 -19
- package/lib/clang/{12.0.1 → 13.0.0}/include/arm_acle.h +55 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/arm_neon.h +1077 -165
- package/lib/clang/{12.0.1 → 13.0.0}/include/arm_sve.h +11791 -5896
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512fintrin.h +177 -37
- package/lib/clang/13.0.0/include/builtins.h +16 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/cuda_wrappers/complex +8 -0
- package/lib/clang/13.0.0/include/hexagon_circ_brev_intrinsics.h +298 -0
- package/lib/clang/13.0.0/include/hexagon_protos.h +8450 -0
- package/lib/clang/13.0.0/include/hexagon_types.h +2653 -0
- package/lib/clang/13.0.0/include/hvx_hexagon_protos.h +4392 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/intrin.h +44 -8
- package/lib/clang/{12.0.1 → 13.0.0}/include/keylockerintrin.h +30 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/opencl-c-base.h +144 -3
- package/lib/clang/{12.0.1 → 13.0.0}/include/opencl-c.h +505 -355
- package/lib/clang/13.0.0/include/openmp_wrappers/__clang_openmp_device_functions.h +106 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/cmath +54 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/complex +1 -7
- package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/complex.h +0 -1
- package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/math.h +10 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/new +2 -24
- package/lib/clang/13.0.0/include/riscv_vector.h +123865 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/uintrintrin.h +7 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/vaesintrin.h +21 -20
- package/lib/clang/{12.0.1 → 13.0.0}/include/vecintrin.h +206 -77
- package/lib/clang/{12.0.1 → 13.0.0}/include/vpclmulqdqintrin.h +2 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/wasm_simd128.h +806 -239
- package/package.json +6 -6
- package/lib/clang/12.0.1/include/__clang_hip_runtime_wrapper.h +0 -69
- package/lib/clang/12.0.1/include/openmp_wrappers/__clang_openmp_device_functions.h +0 -42
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_builtin_vars.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_cmath.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_complex_builtins.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_intrinsics.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_libdevice_declares.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_math.h +2 -2
- package/lib/clang/{12.0.1 → 13.0.0}/include/__clang_cuda_math_forward_declares.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/__stddef_max_align_t.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/__wmmintrin_aes.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/__wmmintrin_pclmul.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/adxintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/ammintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/arm64intr.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/arm_bf16.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/arm_cde.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/arm_cmse.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/arm_fp16.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/arm_mve.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/armintr.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx2intrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512bf16intrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512bitalgintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512bwintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512cdintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512dqintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512erintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512ifmaintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512ifmavlintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512pfintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vbmi2intrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vbmiintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vbmivlintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlbf16intrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlbitalgintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlbwintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlcdintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vldqintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlvbmi2intrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlvnniintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vlvp2intersectintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vnniintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vp2intersectintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vpopcntdqintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avx512vpopcntdqvlintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avxintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/avxvnniintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/bmi2intrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/bmiintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/cet.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/cetintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/cldemoteintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/clflushoptintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/clwbintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/clzerointrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/cpuid.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/cuda_wrappers/algorithm +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/cuda_wrappers/new +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/emmintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/enqcmdintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/f16cintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/float.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/fma4intrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/fmaintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/fxsrintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/gfniintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/hresetintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/htmintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/htmxlintrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/ia32intrin.h +0 -0
- package/lib/clang/{12.0.1 → 13.0.0}/include/immintrin.h +5 -5
- /package/lib/clang/{12.0.1 → 13.0.0}/include/inttypes.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/invpcidintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/iso646.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/limits.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/lwpintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/lzcntintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/mm3dnow.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/mm_malloc.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/mmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/module.modulemap +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/movdirintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/msa.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/mwaitxintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/nmmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/openmp_wrappers/complex_cmath.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/pconfigintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/pkuintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/pmmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/popcntintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/emmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/mm_malloc.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/mmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/pmmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/smmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/tmmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/ppc_wrappers/xmmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/prfchwintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/ptwriteintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/rdseedintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/rtmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/s390intrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/serializeintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/sgxintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/shaintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/smmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/stdalign.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/stdarg.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/stdatomic.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/stdbool.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/stddef.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/stdint.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/stdnoreturn.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/tbmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/tgmath.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/tmmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/tsxldtrkintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/unwind.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/vadefs.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/varargs.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/waitpkgintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/wbnoinvdintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/wmmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/x86gprintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/x86intrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/xmmintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/xopintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/xsavecintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/xsaveintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/xsaveoptintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/xsavesintrin.h +0 -0
- /package/lib/clang/{12.0.1 → 13.0.0}/include/xtestintrin.h +0 -0
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
#ifndef __CLANG_HIP_CMATH_H__
|
|
11
11
|
#define __CLANG_HIP_CMATH_H__
|
|
12
12
|
|
|
13
|
-
#if !defined(__HIP__)
|
|
13
|
+
#if !defined(__HIP__) && !defined(__OPENMP_AMDGCN__)
|
|
14
14
|
#error "This file is for HIP and OpenMP AMDGCN device compilation only."
|
|
15
15
|
#endif
|
|
16
16
|
|
|
17
|
+
#if !defined(__HIPCC_RTC__)
|
|
17
18
|
#if defined(__cplusplus)
|
|
18
19
|
#include <limits>
|
|
19
20
|
#include <type_traits>
|
|
@@ -21,102 +22,162 @@
|
|
|
21
22
|
#endif
|
|
22
23
|
#include <limits.h>
|
|
23
24
|
#include <stdint.h>
|
|
25
|
+
#endif // !defined(__HIPCC_RTC__)
|
|
24
26
|
|
|
25
27
|
#pragma push_macro("__DEVICE__")
|
|
28
|
+
#pragma push_macro("__CONSTEXPR__")
|
|
29
|
+
#ifdef __OPENMP_AMDGCN__
|
|
30
|
+
#define __DEVICE__ static __attribute__((always_inline, nothrow))
|
|
31
|
+
#define __CONSTEXPR__ constexpr
|
|
32
|
+
#else
|
|
26
33
|
#define __DEVICE__ static __device__ inline __attribute__((always_inline))
|
|
34
|
+
#define __CONSTEXPR__
|
|
35
|
+
#endif // __OPENMP_AMDGCN__
|
|
27
36
|
|
|
28
37
|
// Start with functions that cannot be defined by DEF macros below.
|
|
29
38
|
#if defined(__cplusplus)
|
|
30
|
-
|
|
31
|
-
__DEVICE__ float
|
|
32
|
-
__DEVICE__
|
|
33
|
-
__DEVICE__
|
|
34
|
-
|
|
39
|
+
#if defined __OPENMP_AMDGCN__
|
|
40
|
+
__DEVICE__ __CONSTEXPR__ float fabs(float __x) { return ::fabsf(__x); }
|
|
41
|
+
__DEVICE__ __CONSTEXPR__ float sin(float __x) { return ::sinf(__x); }
|
|
42
|
+
__DEVICE__ __CONSTEXPR__ float cos(float __x) { return ::cosf(__x); }
|
|
43
|
+
#endif
|
|
44
|
+
__DEVICE__ __CONSTEXPR__ double abs(double __x) { return ::fabs(__x); }
|
|
45
|
+
__DEVICE__ __CONSTEXPR__ float abs(float __x) { return ::fabsf(__x); }
|
|
46
|
+
__DEVICE__ __CONSTEXPR__ long long abs(long long __n) { return ::llabs(__n); }
|
|
47
|
+
__DEVICE__ __CONSTEXPR__ long abs(long __n) { return ::labs(__n); }
|
|
48
|
+
__DEVICE__ __CONSTEXPR__ float fma(float __x, float __y, float __z) {
|
|
35
49
|
return ::fmaf(__x, __y, __z);
|
|
36
50
|
}
|
|
37
|
-
|
|
51
|
+
#if !defined(__HIPCC_RTC__)
|
|
52
|
+
// The value returned by fpclassify is platform dependent, therefore it is not
|
|
53
|
+
// supported by hipRTC.
|
|
54
|
+
__DEVICE__ __CONSTEXPR__ int fpclassify(float __x) {
|
|
38
55
|
return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
|
|
39
56
|
FP_ZERO, __x);
|
|
40
57
|
}
|
|
41
|
-
__DEVICE__ int fpclassify(double __x) {
|
|
58
|
+
__DEVICE__ __CONSTEXPR__ int fpclassify(double __x) {
|
|
42
59
|
return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
|
|
43
60
|
FP_ZERO, __x);
|
|
44
61
|
}
|
|
45
|
-
|
|
62
|
+
#endif // !defined(__HIPCC_RTC__)
|
|
63
|
+
|
|
64
|
+
__DEVICE__ __CONSTEXPR__ float frexp(float __arg, int *__exp) {
|
|
46
65
|
return ::frexpf(__arg, __exp);
|
|
47
66
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
67
|
+
|
|
68
|
+
#if defined(__OPENMP_AMDGCN__)
|
|
69
|
+
// For OpenMP we work around some old system headers that have non-conforming
|
|
70
|
+
// `isinf(float)` and `isnan(float)` implementations that return an `int`. We do
|
|
71
|
+
// this by providing two versions of these functions, differing only in the
|
|
72
|
+
// return type. To avoid conflicting definitions we disable implicit base
|
|
73
|
+
// function generation. That means we will end up with two specializations, one
|
|
74
|
+
// per type, but only one has a base function defined by the system header.
|
|
75
|
+
#pragma omp begin declare variant match( \
|
|
76
|
+
implementation = {extension(disable_implicit_base)})
|
|
77
|
+
|
|
78
|
+
// FIXME: We lack an extension to customize the mangling of the variants, e.g.,
|
|
79
|
+
// add a suffix. This means we would clash with the names of the variants
|
|
80
|
+
// (note that we do not create implicit base functions here). To avoid
|
|
81
|
+
// this clash we add a new trait to some of them that is always true
|
|
82
|
+
// (this is LLVM after all ;)). It will only influence the mangled name
|
|
83
|
+
// of the variants inside the inner region and avoid the clash.
|
|
84
|
+
#pragma omp begin declare variant match(implementation = {vendor(llvm)})
|
|
85
|
+
|
|
86
|
+
__DEVICE__ __CONSTEXPR__ int isinf(float __x) { return ::__isinff(__x); }
|
|
87
|
+
__DEVICE__ __CONSTEXPR__ int isinf(double __x) { return ::__isinf(__x); }
|
|
88
|
+
__DEVICE__ __CONSTEXPR__ int isfinite(float __x) { return ::__finitef(__x); }
|
|
89
|
+
__DEVICE__ __CONSTEXPR__ int isfinite(double __x) { return ::__finite(__x); }
|
|
90
|
+
__DEVICE__ __CONSTEXPR__ int isnan(float __x) { return ::__isnanf(__x); }
|
|
91
|
+
__DEVICE__ __CONSTEXPR__ int isnan(double __x) { return ::__isnan(__x); }
|
|
92
|
+
|
|
93
|
+
#pragma omp end declare variant
|
|
94
|
+
#endif // defined(__OPENMP_AMDGCN__)
|
|
95
|
+
|
|
96
|
+
__DEVICE__ __CONSTEXPR__ bool isinf(float __x) { return ::__isinff(__x); }
|
|
97
|
+
__DEVICE__ __CONSTEXPR__ bool isinf(double __x) { return ::__isinf(__x); }
|
|
98
|
+
__DEVICE__ __CONSTEXPR__ bool isfinite(float __x) { return ::__finitef(__x); }
|
|
99
|
+
__DEVICE__ __CONSTEXPR__ bool isfinite(double __x) { return ::__finite(__x); }
|
|
100
|
+
__DEVICE__ __CONSTEXPR__ bool isnan(float __x) { return ::__isnanf(__x); }
|
|
101
|
+
__DEVICE__ __CONSTEXPR__ bool isnan(double __x) { return ::__isnan(__x); }
|
|
102
|
+
|
|
103
|
+
#if defined(__OPENMP_AMDGCN__)
|
|
104
|
+
#pragma omp end declare variant
|
|
105
|
+
#endif // defined(__OPENMP_AMDGCN__)
|
|
106
|
+
|
|
107
|
+
__DEVICE__ __CONSTEXPR__ bool isgreater(float __x, float __y) {
|
|
51
108
|
return __builtin_isgreater(__x, __y);
|
|
52
109
|
}
|
|
53
|
-
__DEVICE__ bool isgreater(double __x, double __y) {
|
|
110
|
+
__DEVICE__ __CONSTEXPR__ bool isgreater(double __x, double __y) {
|
|
54
111
|
return __builtin_isgreater(__x, __y);
|
|
55
112
|
}
|
|
56
|
-
__DEVICE__ bool isgreaterequal(float __x, float __y) {
|
|
113
|
+
__DEVICE__ __CONSTEXPR__ bool isgreaterequal(float __x, float __y) {
|
|
57
114
|
return __builtin_isgreaterequal(__x, __y);
|
|
58
115
|
}
|
|
59
|
-
__DEVICE__ bool isgreaterequal(double __x, double __y) {
|
|
116
|
+
__DEVICE__ __CONSTEXPR__ bool isgreaterequal(double __x, double __y) {
|
|
60
117
|
return __builtin_isgreaterequal(__x, __y);
|
|
61
118
|
}
|
|
62
|
-
__DEVICE__ bool
|
|
63
|
-
__DEVICE__ bool isinf(double __x) { return ::__isinf(__x); }
|
|
64
|
-
__DEVICE__ bool isless(float __x, float __y) {
|
|
119
|
+
__DEVICE__ __CONSTEXPR__ bool isless(float __x, float __y) {
|
|
65
120
|
return __builtin_isless(__x, __y);
|
|
66
121
|
}
|
|
67
|
-
__DEVICE__ bool isless(double __x, double __y) {
|
|
122
|
+
__DEVICE__ __CONSTEXPR__ bool isless(double __x, double __y) {
|
|
68
123
|
return __builtin_isless(__x, __y);
|
|
69
124
|
}
|
|
70
|
-
__DEVICE__ bool islessequal(float __x, float __y) {
|
|
125
|
+
__DEVICE__ __CONSTEXPR__ bool islessequal(float __x, float __y) {
|
|
71
126
|
return __builtin_islessequal(__x, __y);
|
|
72
127
|
}
|
|
73
|
-
__DEVICE__ bool islessequal(double __x, double __y) {
|
|
128
|
+
__DEVICE__ __CONSTEXPR__ bool islessequal(double __x, double __y) {
|
|
74
129
|
return __builtin_islessequal(__x, __y);
|
|
75
130
|
}
|
|
76
|
-
__DEVICE__ bool islessgreater(float __x, float __y) {
|
|
131
|
+
__DEVICE__ __CONSTEXPR__ bool islessgreater(float __x, float __y) {
|
|
77
132
|
return __builtin_islessgreater(__x, __y);
|
|
78
133
|
}
|
|
79
|
-
__DEVICE__ bool islessgreater(double __x, double __y) {
|
|
134
|
+
__DEVICE__ __CONSTEXPR__ bool islessgreater(double __x, double __y) {
|
|
80
135
|
return __builtin_islessgreater(__x, __y);
|
|
81
136
|
}
|
|
82
|
-
__DEVICE__ bool
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
__DEVICE__ bool isnormal(double __x) {
|
|
86
|
-
|
|
137
|
+
__DEVICE__ __CONSTEXPR__ bool isnormal(float __x) {
|
|
138
|
+
return __builtin_isnormal(__x);
|
|
139
|
+
}
|
|
140
|
+
__DEVICE__ __CONSTEXPR__ bool isnormal(double __x) {
|
|
141
|
+
return __builtin_isnormal(__x);
|
|
142
|
+
}
|
|
143
|
+
__DEVICE__ __CONSTEXPR__ bool isunordered(float __x, float __y) {
|
|
87
144
|
return __builtin_isunordered(__x, __y);
|
|
88
145
|
}
|
|
89
|
-
__DEVICE__ bool isunordered(double __x, double __y) {
|
|
146
|
+
__DEVICE__ __CONSTEXPR__ bool isunordered(double __x, double __y) {
|
|
90
147
|
return __builtin_isunordered(__x, __y);
|
|
91
148
|
}
|
|
92
|
-
__DEVICE__ float modf(float __x, float *__iptr) {
|
|
93
|
-
|
|
149
|
+
__DEVICE__ __CONSTEXPR__ float modf(float __x, float *__iptr) {
|
|
150
|
+
return ::modff(__x, __iptr);
|
|
151
|
+
}
|
|
152
|
+
__DEVICE__ __CONSTEXPR__ float pow(float __base, int __iexp) {
|
|
94
153
|
return ::powif(__base, __iexp);
|
|
95
154
|
}
|
|
96
|
-
__DEVICE__ double pow(double __base, int __iexp) {
|
|
155
|
+
__DEVICE__ __CONSTEXPR__ double pow(double __base, int __iexp) {
|
|
97
156
|
return ::powi(__base, __iexp);
|
|
98
157
|
}
|
|
99
|
-
__DEVICE__ float remquo(float __x, float __y, int *__quo) {
|
|
158
|
+
__DEVICE__ __CONSTEXPR__ float remquo(float __x, float __y, int *__quo) {
|
|
100
159
|
return ::remquof(__x, __y, __quo);
|
|
101
160
|
}
|
|
102
|
-
__DEVICE__ float scalbln(float __x, long int __n) {
|
|
161
|
+
__DEVICE__ __CONSTEXPR__ float scalbln(float __x, long int __n) {
|
|
103
162
|
return ::scalblnf(__x, __n);
|
|
104
163
|
}
|
|
105
|
-
__DEVICE__ bool signbit(float __x) { return ::__signbitf(__x); }
|
|
106
|
-
__DEVICE__ bool signbit(double __x) { return ::__signbit(__x); }
|
|
164
|
+
__DEVICE__ __CONSTEXPR__ bool signbit(float __x) { return ::__signbitf(__x); }
|
|
165
|
+
__DEVICE__ __CONSTEXPR__ bool signbit(double __x) { return ::__signbit(__x); }
|
|
107
166
|
|
|
108
167
|
// Notably missing above is nexttoward. We omit it because
|
|
109
168
|
// ocml doesn't provide an implementation, and we don't want to be in the
|
|
110
169
|
// business of implementing tricky libm functions in this header.
|
|
111
170
|
|
|
112
171
|
// Other functions.
|
|
113
|
-
__DEVICE__ _Float16 fma(_Float16 __x, _Float16 __y,
|
|
172
|
+
__DEVICE__ __CONSTEXPR__ _Float16 fma(_Float16 __x, _Float16 __y,
|
|
173
|
+
_Float16 __z) {
|
|
114
174
|
return __ocml_fma_f16(__x, __y, __z);
|
|
115
175
|
}
|
|
116
|
-
__DEVICE__ _Float16 pow(_Float16 __base, int __iexp) {
|
|
176
|
+
__DEVICE__ __CONSTEXPR__ _Float16 pow(_Float16 __base, int __iexp) {
|
|
117
177
|
return __ocml_pown_f16(__base, __iexp);
|
|
118
178
|
}
|
|
119
179
|
|
|
180
|
+
#ifndef __OPENMP_AMDGCN__
|
|
120
181
|
// BEGIN DEF_FUN and HIP_OVERLOAD
|
|
121
182
|
|
|
122
183
|
// BEGIN DEF_FUN
|
|
@@ -127,18 +188,19 @@ __DEVICE__ _Float16 pow(_Float16 __base, int __iexp) {
|
|
|
127
188
|
|
|
128
189
|
// Define cmath functions with float argument and returns __retty.
|
|
129
190
|
#define __DEF_FUN1(__retty, __func) \
|
|
130
|
-
__DEVICE__
|
|
131
|
-
__retty __func(float __x) { return __func##f(__x); }
|
|
191
|
+
__DEVICE__ __CONSTEXPR__ __retty __func(float __x) { return __func##f(__x); }
|
|
132
192
|
|
|
133
193
|
// Define cmath functions with two float arguments and returns __retty.
|
|
134
194
|
#define __DEF_FUN2(__retty, __func) \
|
|
135
|
-
__DEVICE__
|
|
136
|
-
|
|
195
|
+
__DEVICE__ __CONSTEXPR__ __retty __func(float __x, float __y) { \
|
|
196
|
+
return __func##f(__x, __y); \
|
|
197
|
+
}
|
|
137
198
|
|
|
138
199
|
// Define cmath functions with a float and an int argument and returns __retty.
|
|
139
200
|
#define __DEF_FUN2_FI(__retty, __func) \
|
|
140
|
-
__DEVICE__
|
|
141
|
-
|
|
201
|
+
__DEVICE__ __CONSTEXPR__ __retty __func(float __x, int __y) { \
|
|
202
|
+
return __func##f(__x, __y); \
|
|
203
|
+
}
|
|
142
204
|
|
|
143
205
|
__DEF_FUN1(float, acos)
|
|
144
206
|
__DEF_FUN1(float, acosh)
|
|
@@ -207,11 +269,117 @@ template <bool __B, class __T = void> struct __hip_enable_if {};
|
|
|
207
269
|
|
|
208
270
|
template <class __T> struct __hip_enable_if<true, __T> { typedef __T type; };
|
|
209
271
|
|
|
272
|
+
namespace __hip {
|
|
273
|
+
template <class _Tp> struct is_integral {
|
|
274
|
+
enum { value = 0 };
|
|
275
|
+
};
|
|
276
|
+
template <> struct is_integral<bool> {
|
|
277
|
+
enum { value = 1 };
|
|
278
|
+
};
|
|
279
|
+
template <> struct is_integral<char> {
|
|
280
|
+
enum { value = 1 };
|
|
281
|
+
};
|
|
282
|
+
template <> struct is_integral<signed char> {
|
|
283
|
+
enum { value = 1 };
|
|
284
|
+
};
|
|
285
|
+
template <> struct is_integral<unsigned char> {
|
|
286
|
+
enum { value = 1 };
|
|
287
|
+
};
|
|
288
|
+
template <> struct is_integral<wchar_t> {
|
|
289
|
+
enum { value = 1 };
|
|
290
|
+
};
|
|
291
|
+
template <> struct is_integral<short> {
|
|
292
|
+
enum { value = 1 };
|
|
293
|
+
};
|
|
294
|
+
template <> struct is_integral<unsigned short> {
|
|
295
|
+
enum { value = 1 };
|
|
296
|
+
};
|
|
297
|
+
template <> struct is_integral<int> {
|
|
298
|
+
enum { value = 1 };
|
|
299
|
+
};
|
|
300
|
+
template <> struct is_integral<unsigned int> {
|
|
301
|
+
enum { value = 1 };
|
|
302
|
+
};
|
|
303
|
+
template <> struct is_integral<long> {
|
|
304
|
+
enum { value = 1 };
|
|
305
|
+
};
|
|
306
|
+
template <> struct is_integral<unsigned long> {
|
|
307
|
+
enum { value = 1 };
|
|
308
|
+
};
|
|
309
|
+
template <> struct is_integral<long long> {
|
|
310
|
+
enum { value = 1 };
|
|
311
|
+
};
|
|
312
|
+
template <> struct is_integral<unsigned long long> {
|
|
313
|
+
enum { value = 1 };
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// ToDo: specializes is_arithmetic<_Float16>
|
|
317
|
+
template <class _Tp> struct is_arithmetic {
|
|
318
|
+
enum { value = 0 };
|
|
319
|
+
};
|
|
320
|
+
template <> struct is_arithmetic<bool> {
|
|
321
|
+
enum { value = 1 };
|
|
322
|
+
};
|
|
323
|
+
template <> struct is_arithmetic<char> {
|
|
324
|
+
enum { value = 1 };
|
|
325
|
+
};
|
|
326
|
+
template <> struct is_arithmetic<signed char> {
|
|
327
|
+
enum { value = 1 };
|
|
328
|
+
};
|
|
329
|
+
template <> struct is_arithmetic<unsigned char> {
|
|
330
|
+
enum { value = 1 };
|
|
331
|
+
};
|
|
332
|
+
template <> struct is_arithmetic<wchar_t> {
|
|
333
|
+
enum { value = 1 };
|
|
334
|
+
};
|
|
335
|
+
template <> struct is_arithmetic<short> {
|
|
336
|
+
enum { value = 1 };
|
|
337
|
+
};
|
|
338
|
+
template <> struct is_arithmetic<unsigned short> {
|
|
339
|
+
enum { value = 1 };
|
|
340
|
+
};
|
|
341
|
+
template <> struct is_arithmetic<int> {
|
|
342
|
+
enum { value = 1 };
|
|
343
|
+
};
|
|
344
|
+
template <> struct is_arithmetic<unsigned int> {
|
|
345
|
+
enum { value = 1 };
|
|
346
|
+
};
|
|
347
|
+
template <> struct is_arithmetic<long> {
|
|
348
|
+
enum { value = 1 };
|
|
349
|
+
};
|
|
350
|
+
template <> struct is_arithmetic<unsigned long> {
|
|
351
|
+
enum { value = 1 };
|
|
352
|
+
};
|
|
353
|
+
template <> struct is_arithmetic<long long> {
|
|
354
|
+
enum { value = 1 };
|
|
355
|
+
};
|
|
356
|
+
template <> struct is_arithmetic<unsigned long long> {
|
|
357
|
+
enum { value = 1 };
|
|
358
|
+
};
|
|
359
|
+
template <> struct is_arithmetic<float> {
|
|
360
|
+
enum { value = 1 };
|
|
361
|
+
};
|
|
362
|
+
template <> struct is_arithmetic<double> {
|
|
363
|
+
enum { value = 1 };
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
struct true_type {
|
|
367
|
+
static const __constant__ bool value = true;
|
|
368
|
+
};
|
|
369
|
+
struct false_type {
|
|
370
|
+
static const __constant__ bool value = false;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
template <typename __T, typename __U> struct is_same : public false_type {};
|
|
374
|
+
template <typename __T> struct is_same<__T, __T> : public true_type {};
|
|
375
|
+
|
|
376
|
+
template <typename __T> struct add_rvalue_reference { typedef __T &&type; };
|
|
377
|
+
|
|
378
|
+
template <typename __T> typename add_rvalue_reference<__T>::type declval();
|
|
379
|
+
|
|
210
380
|
// decltype is only available in C++11 and above.
|
|
211
381
|
#if __cplusplus >= 201103L
|
|
212
382
|
// __hip_promote
|
|
213
|
-
namespace __hip {
|
|
214
|
-
|
|
215
383
|
template <class _Tp> struct __numeric_type {
|
|
216
384
|
static void __test(...);
|
|
217
385
|
static _Float16 __test(_Float16);
|
|
@@ -227,8 +395,8 @@ template <class _Tp> struct __numeric_type {
|
|
|
227
395
|
// No support for long double, use double instead.
|
|
228
396
|
static double __test(long double);
|
|
229
397
|
|
|
230
|
-
typedef decltype(__test(
|
|
231
|
-
static const bool value = !
|
|
398
|
+
typedef decltype(__test(declval<_Tp>())) type;
|
|
399
|
+
static const bool value = !is_same<type, void>::value;
|
|
232
400
|
};
|
|
233
401
|
|
|
234
402
|
template <> struct __numeric_type<void> { static const bool value = true; };
|
|
@@ -271,18 +439,17 @@ public:
|
|
|
271
439
|
|
|
272
440
|
template <class _A1, class _A2 = void, class _A3 = void>
|
|
273
441
|
class __promote : public __promote_imp<_A1, _A2, _A3> {};
|
|
274
|
-
|
|
275
|
-
} // namespace __hip
|
|
276
442
|
#endif //__cplusplus >= 201103L
|
|
443
|
+
} // namespace __hip
|
|
277
444
|
|
|
278
445
|
// __HIP_OVERLOAD1 is used to resolve function calls with integer argument to
|
|
279
446
|
// avoid compilation error due to ambibuity. e.g. floor(5) is resolved with
|
|
280
447
|
// floor(double).
|
|
281
448
|
#define __HIP_OVERLOAD1(__retty, __fn) \
|
|
282
449
|
template <typename __T> \
|
|
283
|
-
__DEVICE__
|
|
284
|
-
|
|
285
|
-
|
|
450
|
+
__DEVICE__ __CONSTEXPR__ \
|
|
451
|
+
typename __hip_enable_if<__hip::is_integral<__T>::value, __retty>::type \
|
|
452
|
+
__fn(__T __x) { \
|
|
286
453
|
return ::__fn((double)__x); \
|
|
287
454
|
}
|
|
288
455
|
|
|
@@ -292,9 +459,8 @@ class __promote : public __promote_imp<_A1, _A2, _A3> {};
|
|
|
292
459
|
#if __cplusplus >= 201103L
|
|
293
460
|
#define __HIP_OVERLOAD2(__retty, __fn) \
|
|
294
461
|
template <typename __T1, typename __T2> \
|
|
295
|
-
__DEVICE__ typename __hip_enable_if<
|
|
296
|
-
|
|
297
|
-
std::numeric_limits<__T2>::is_specialized, \
|
|
462
|
+
__DEVICE__ __CONSTEXPR__ typename __hip_enable_if< \
|
|
463
|
+
__hip::is_arithmetic<__T1>::value && __hip::is_arithmetic<__T2>::value, \
|
|
298
464
|
typename __hip::__promote<__T1, __T2>::type>::type \
|
|
299
465
|
__fn(__T1 __x, __T2 __y) { \
|
|
300
466
|
typedef typename __hip::__promote<__T1, __T2>::type __result_type; \
|
|
@@ -303,16 +469,15 @@ class __promote : public __promote_imp<_A1, _A2, _A3> {};
|
|
|
303
469
|
#else
|
|
304
470
|
#define __HIP_OVERLOAD2(__retty, __fn) \
|
|
305
471
|
template <typename __T1, typename __T2> \
|
|
306
|
-
__DEVICE__
|
|
307
|
-
typename __hip_enable_if<
|
|
308
|
-
|
|
472
|
+
__DEVICE__ __CONSTEXPR__ \
|
|
473
|
+
typename __hip_enable_if<__hip::is_arithmetic<__T1>::value && \
|
|
474
|
+
__hip::is_arithmetic<__T2>::value, \
|
|
309
475
|
__retty>::type \
|
|
310
476
|
__fn(__T1 __x, __T2 __y) { \
|
|
311
477
|
return __fn((double)__x, (double)__y); \
|
|
312
478
|
}
|
|
313
479
|
#endif
|
|
314
480
|
|
|
315
|
-
__HIP_OVERLOAD1(double, abs)
|
|
316
481
|
__HIP_OVERLOAD1(double, acos)
|
|
317
482
|
__HIP_OVERLOAD1(double, acosh)
|
|
318
483
|
__HIP_OVERLOAD1(double, asin)
|
|
@@ -336,7 +501,9 @@ __HIP_OVERLOAD1(double, floor)
|
|
|
336
501
|
__HIP_OVERLOAD2(double, fmax)
|
|
337
502
|
__HIP_OVERLOAD2(double, fmin)
|
|
338
503
|
__HIP_OVERLOAD2(double, fmod)
|
|
504
|
+
#if !defined(__HIPCC_RTC__)
|
|
339
505
|
__HIP_OVERLOAD1(int, fpclassify)
|
|
506
|
+
#endif // !defined(__HIPCC_RTC__)
|
|
340
507
|
__HIP_OVERLOAD2(double, hypot)
|
|
341
508
|
__HIP_OVERLOAD1(int, ilogb)
|
|
342
509
|
__HIP_OVERLOAD1(bool, isfinite)
|
|
@@ -381,10 +548,9 @@ __HIP_OVERLOAD2(double, min)
|
|
|
381
548
|
// Additional Overloads that don't quite match HIP_OVERLOAD.
|
|
382
549
|
#if __cplusplus >= 201103L
|
|
383
550
|
template <typename __T1, typename __T2, typename __T3>
|
|
384
|
-
__DEVICE__ typename __hip_enable_if<
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
std::numeric_limits<__T3>::is_specialized,
|
|
551
|
+
__DEVICE__ __CONSTEXPR__ typename __hip_enable_if<
|
|
552
|
+
__hip::is_arithmetic<__T1>::value && __hip::is_arithmetic<__T2>::value &&
|
|
553
|
+
__hip::is_arithmetic<__T3>::value,
|
|
388
554
|
typename __hip::__promote<__T1, __T2, __T3>::type>::type
|
|
389
555
|
fma(__T1 __x, __T2 __y, __T3 __z) {
|
|
390
556
|
typedef typename __hip::__promote<__T1, __T2, __T3>::type __result_type;
|
|
@@ -392,10 +558,10 @@ fma(__T1 __x, __T2 __y, __T3 __z) {
|
|
|
392
558
|
}
|
|
393
559
|
#else
|
|
394
560
|
template <typename __T1, typename __T2, typename __T3>
|
|
395
|
-
__DEVICE__
|
|
396
|
-
typename __hip_enable_if<
|
|
397
|
-
|
|
398
|
-
|
|
561
|
+
__DEVICE__ __CONSTEXPR__
|
|
562
|
+
typename __hip_enable_if<__hip::is_arithmetic<__T1>::value &&
|
|
563
|
+
__hip::is_arithmetic<__T2>::value &&
|
|
564
|
+
__hip::is_arithmetic<__T3>::value,
|
|
399
565
|
double>::type
|
|
400
566
|
fma(__T1 __x, __T2 __y, __T3 __z) {
|
|
401
567
|
return ::fma((double)__x, (double)__y, (double)__z);
|
|
@@ -403,31 +569,31 @@ __DEVICE__
|
|
|
403
569
|
#endif
|
|
404
570
|
|
|
405
571
|
template <typename __T>
|
|
406
|
-
__DEVICE__
|
|
407
|
-
typename __hip_enable_if<
|
|
572
|
+
__DEVICE__ __CONSTEXPR__
|
|
573
|
+
typename __hip_enable_if<__hip::is_integral<__T>::value, double>::type
|
|
408
574
|
frexp(__T __x, int *__exp) {
|
|
409
575
|
return ::frexp((double)__x, __exp);
|
|
410
576
|
}
|
|
411
577
|
|
|
412
578
|
template <typename __T>
|
|
413
|
-
__DEVICE__
|
|
414
|
-
typename __hip_enable_if<
|
|
579
|
+
__DEVICE__ __CONSTEXPR__
|
|
580
|
+
typename __hip_enable_if<__hip::is_integral<__T>::value, double>::type
|
|
415
581
|
ldexp(__T __x, int __exp) {
|
|
416
582
|
return ::ldexp((double)__x, __exp);
|
|
417
583
|
}
|
|
418
584
|
|
|
419
585
|
template <typename __T>
|
|
420
|
-
__DEVICE__
|
|
421
|
-
typename __hip_enable_if<
|
|
586
|
+
__DEVICE__ __CONSTEXPR__
|
|
587
|
+
typename __hip_enable_if<__hip::is_integral<__T>::value, double>::type
|
|
422
588
|
modf(__T __x, double *__exp) {
|
|
423
589
|
return ::modf((double)__x, __exp);
|
|
424
590
|
}
|
|
425
591
|
|
|
426
592
|
#if __cplusplus >= 201103L
|
|
427
593
|
template <typename __T1, typename __T2>
|
|
428
|
-
__DEVICE__
|
|
429
|
-
typename __hip_enable_if<
|
|
430
|
-
|
|
594
|
+
__DEVICE__ __CONSTEXPR__
|
|
595
|
+
typename __hip_enable_if<__hip::is_arithmetic<__T1>::value &&
|
|
596
|
+
__hip::is_arithmetic<__T2>::value,
|
|
431
597
|
typename __hip::__promote<__T1, __T2>::type>::type
|
|
432
598
|
remquo(__T1 __x, __T2 __y, int *__quo) {
|
|
433
599
|
typedef typename __hip::__promote<__T1, __T2>::type __result_type;
|
|
@@ -435,9 +601,9 @@ __DEVICE__
|
|
|
435
601
|
}
|
|
436
602
|
#else
|
|
437
603
|
template <typename __T1, typename __T2>
|
|
438
|
-
__DEVICE__
|
|
439
|
-
typename __hip_enable_if<
|
|
440
|
-
|
|
604
|
+
__DEVICE__ __CONSTEXPR__
|
|
605
|
+
typename __hip_enable_if<__hip::is_arithmetic<__T1>::value &&
|
|
606
|
+
__hip::is_arithmetic<__T2>::value,
|
|
441
607
|
double>::type
|
|
442
608
|
remquo(__T1 __x, __T2 __y, int *__quo) {
|
|
443
609
|
return ::remquo((double)__x, (double)__y, __quo);
|
|
@@ -445,15 +611,15 @@ __DEVICE__
|
|
|
445
611
|
#endif
|
|
446
612
|
|
|
447
613
|
template <typename __T>
|
|
448
|
-
__DEVICE__
|
|
449
|
-
typename __hip_enable_if<
|
|
614
|
+
__DEVICE__ __CONSTEXPR__
|
|
615
|
+
typename __hip_enable_if<__hip::is_integral<__T>::value, double>::type
|
|
450
616
|
scalbln(__T __x, long int __exp) {
|
|
451
617
|
return ::scalbln((double)__x, __exp);
|
|
452
618
|
}
|
|
453
619
|
|
|
454
620
|
template <typename __T>
|
|
455
|
-
__DEVICE__
|
|
456
|
-
typename __hip_enable_if<
|
|
621
|
+
__DEVICE__ __CONSTEXPR__
|
|
622
|
+
typename __hip_enable_if<__hip::is_integral<__T>::value, double>::type
|
|
457
623
|
scalbn(__T __x, int __exp) {
|
|
458
624
|
return ::scalbn((double)__x, __exp);
|
|
459
625
|
}
|
|
@@ -465,17 +631,20 @@ __DEVICE__
|
|
|
465
631
|
|
|
466
632
|
// END DEF_FUN and HIP_OVERLOAD
|
|
467
633
|
|
|
634
|
+
#endif // ifndef __OPENMP_AMDGCN__
|
|
468
635
|
#endif // defined(__cplusplus)
|
|
469
636
|
|
|
637
|
+
#ifndef __OPENMP_AMDGCN__
|
|
470
638
|
// Define these overloads inside the namespace our standard library uses.
|
|
639
|
+
#if !defined(__HIPCC_RTC__)
|
|
471
640
|
#ifdef _LIBCPP_BEGIN_NAMESPACE_STD
|
|
472
641
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
|
473
642
|
#else
|
|
474
643
|
namespace std {
|
|
475
644
|
#ifdef _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|
476
645
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|
477
|
-
#endif
|
|
478
|
-
#endif
|
|
646
|
+
#endif // _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|
647
|
+
#endif // _LIBCPP_BEGIN_NAMESPACE_STD
|
|
479
648
|
|
|
480
649
|
// Pull the new overloads we defined above into namespace std.
|
|
481
650
|
// using ::abs; - This may be considered for C++.
|
|
@@ -620,11 +789,13 @@ _LIBCPP_END_NAMESPACE_STD
|
|
|
620
789
|
#else
|
|
621
790
|
#ifdef _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|
622
791
|
_GLIBCXX_END_NAMESPACE_VERSION
|
|
623
|
-
#endif
|
|
792
|
+
#endif // _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|
624
793
|
} // namespace std
|
|
625
|
-
#endif
|
|
794
|
+
#endif // _LIBCPP_END_NAMESPACE_STD
|
|
795
|
+
#endif // !defined(__HIPCC_RTC__)
|
|
626
796
|
|
|
627
797
|
// Define device-side math functions from <ymath.h> on MSVC.
|
|
798
|
+
#if !defined(__HIPCC_RTC__)
|
|
628
799
|
#if defined(_MSC_VER)
|
|
629
800
|
|
|
630
801
|
// Before VS2019, `<ymath.h>` is also included in `<limits>` and other headers.
|
|
@@ -636,29 +807,36 @@ _GLIBCXX_END_NAMESPACE_VERSION
|
|
|
636
807
|
#if defined(__cplusplus)
|
|
637
808
|
extern "C" {
|
|
638
809
|
#endif // defined(__cplusplus)
|
|
639
|
-
__DEVICE__ __attribute__((overloadable)) double _Cosh(double x,
|
|
810
|
+
__DEVICE__ __CONSTEXPR__ __attribute__((overloadable)) double _Cosh(double x,
|
|
811
|
+
double y) {
|
|
640
812
|
return cosh(x) * y;
|
|
641
813
|
}
|
|
642
|
-
__DEVICE__ __attribute__((overloadable)) float _FCosh(float x,
|
|
814
|
+
__DEVICE__ __CONSTEXPR__ __attribute__((overloadable)) float _FCosh(float x,
|
|
815
|
+
float y) {
|
|
643
816
|
return coshf(x) * y;
|
|
644
817
|
}
|
|
645
|
-
__DEVICE__ __attribute__((overloadable)) short _Dtest(double *p) {
|
|
818
|
+
__DEVICE__ __CONSTEXPR__ __attribute__((overloadable)) short _Dtest(double *p) {
|
|
646
819
|
return fpclassify(*p);
|
|
647
820
|
}
|
|
648
|
-
__DEVICE__ __attribute__((overloadable)) short _FDtest(float *p) {
|
|
821
|
+
__DEVICE__ __CONSTEXPR__ __attribute__((overloadable)) short _FDtest(float *p) {
|
|
649
822
|
return fpclassify(*p);
|
|
650
823
|
}
|
|
651
|
-
__DEVICE__ __attribute__((overloadable)) double _Sinh(double x,
|
|
824
|
+
__DEVICE__ __CONSTEXPR__ __attribute__((overloadable)) double _Sinh(double x,
|
|
825
|
+
double y) {
|
|
652
826
|
return sinh(x) * y;
|
|
653
827
|
}
|
|
654
|
-
__DEVICE__ __attribute__((overloadable)) float _FSinh(float x,
|
|
828
|
+
__DEVICE__ __CONSTEXPR__ __attribute__((overloadable)) float _FSinh(float x,
|
|
829
|
+
float y) {
|
|
655
830
|
return sinhf(x) * y;
|
|
656
831
|
}
|
|
657
832
|
#if defined(__cplusplus)
|
|
658
833
|
}
|
|
659
834
|
#endif // defined(__cplusplus)
|
|
660
835
|
#endif // defined(_MSC_VER)
|
|
836
|
+
#endif // !defined(__HIPCC_RTC__)
|
|
837
|
+
#endif // ifndef __OPENMP_AMDGCN__
|
|
661
838
|
|
|
662
839
|
#pragma pop_macro("__DEVICE__")
|
|
840
|
+
#pragma pop_macro("__CONSTEXPR__")
|
|
663
841
|
|
|
664
842
|
#endif // __CLANG_HIP_CMATH_H__
|
|
@@ -138,14 +138,22 @@ __device__ __attribute__((const)) float __ocml_fma_rtn_f32(float, float, float);
|
|
|
138
138
|
__device__ __attribute__((const)) float __ocml_fma_rtp_f32(float, float, float);
|
|
139
139
|
__device__ __attribute__((const)) float __ocml_fma_rtz_f32(float, float, float);
|
|
140
140
|
|
|
141
|
-
__device__ __attribute__((const)) float
|
|
142
|
-
__llvm_amdgcn_cos_f32(float)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
__device__ __attribute__((const)) float
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
__device__ inline __attribute__((const)) float
|
|
142
|
+
__llvm_amdgcn_cos_f32(float __x) {
|
|
143
|
+
return __builtin_amdgcn_cosf(__x);
|
|
144
|
+
}
|
|
145
|
+
__device__ inline __attribute__((const)) float
|
|
146
|
+
__llvm_amdgcn_rcp_f32(float __x) {
|
|
147
|
+
return __builtin_amdgcn_rcpf(__x);
|
|
148
|
+
}
|
|
149
|
+
__device__ inline __attribute__((const)) float
|
|
150
|
+
__llvm_amdgcn_rsq_f32(float __x) {
|
|
151
|
+
return __builtin_amdgcn_rsqf(__x);
|
|
152
|
+
}
|
|
153
|
+
__device__ inline __attribute__((const)) float
|
|
154
|
+
__llvm_amdgcn_sin_f32(float __x) {
|
|
155
|
+
return __builtin_amdgcn_sinf(__x);
|
|
156
|
+
}
|
|
149
157
|
// END INTRINSICS
|
|
150
158
|
// END FLOAT
|
|
151
159
|
|
|
@@ -269,10 +277,14 @@ __device__ __attribute__((const)) double __ocml_fma_rtp_f64(double, double,
|
|
|
269
277
|
__device__ __attribute__((const)) double __ocml_fma_rtz_f64(double, double,
|
|
270
278
|
double);
|
|
271
279
|
|
|
272
|
-
__device__ __attribute__((const)) double
|
|
273
|
-
__llvm_amdgcn_rcp_f64(double)
|
|
274
|
-
|
|
275
|
-
|
|
280
|
+
__device__ inline __attribute__((const)) double
|
|
281
|
+
__llvm_amdgcn_rcp_f64(double __x) {
|
|
282
|
+
return __builtin_amdgcn_rcp(__x);
|
|
283
|
+
}
|
|
284
|
+
__device__ inline __attribute__((const)) double
|
|
285
|
+
__llvm_amdgcn_rsq_f64(double __x) {
|
|
286
|
+
return __builtin_amdgcn_rsq(__x);
|
|
287
|
+
}
|
|
276
288
|
|
|
277
289
|
__device__ __attribute__((const)) _Float16 __ocml_ceil_f16(_Float16);
|
|
278
290
|
__device__ _Float16 __ocml_cos_f16(_Float16);
|