9 #ifndef __CLANG_CUDA_MATH_H__
10 #define __CLANG_CUDA_MATH_H__
12 #error "This file is for CUDA compilation only."
15 #ifndef __OPENMP_NVPTX__
16 #if CUDA_VERSION < 9000
17 #error This file is intended to be used with CUDA-9+ only.
24 #pragma push_macro("__DEVICE__")
25 #ifdef __OPENMP_NVPTX__
26 #if defined(__cplusplus)
27 #define __DEVICE__ static constexpr __attribute__((always_inline, nothrow))
29 #define __DEVICE__ static __attribute__((always_inline, nothrow))
32 #define __DEVICE__ static __device__ __forceinline__
38 #pragma push_macro("__DEVICE_VOID__")
39 #ifdef __OPENMP_NVPTX__ && defined(__cplusplus) && __cplusplus < 201402L
40 #define __DEVICE_VOID__ static __attribute__((always_inline, nothrow))
42 #define __DEVICE_VOID__ __DEVICE__
49 #pragma push_macro("__FAST_OR_SLOW")
50 #if defined(__CLANG_CUDA_APPROX_TRANSCENDENTALS__)
51 #define __FAST_OR_SLOW(fast, slow) fast
53 #define __FAST_OR_SLOW(fast, slow) slow
117 #if __FAST_MATH__ && !__CUDA_PREC_DIV
149 #if defined(__LP64__) || defined(_WIN64)
183 #if defined(__LP64__) || defined(_WIN64)
282 return __a > 0 ? 0.0 : -0.0;
289 return __a > 0 ? 0.f : -0.f;
323 unsigned long long __b) {
327 unsigned long long __b) {
343 #pragma pop_macro("__DEVICE__")
344 #pragma pop_macro("__DEVICE_VOID__")
345 #pragma pop_macro("__FAST_OR_SLOW")
__DEVICE__ long long __float2ll_rn(float __a)
__DEVICE__ int __float2int_rn(float __a)
__DEVICE__ float __nv_tanhf(float __a)
__DEVICE__ long long __nv_llrint(double __a)
__DEVICE__ float __nv_expm1f(float __a)
__DEVICE__ double __nv_log(double __a)
__DEVICE__ double __nv_acosh(double __a)
__DEVICE__ double __nv_log2(double __a)
__DEVICE__ float __nv_nextafterf(float __a, float __b)
__DEVICE__ double __nv_remainder(double __a, double __b)
__DEVICE__ double __nv_sinpi(double __a)
__DEVICE__ float __nv_fabsf(float __a)
__DEVICE__ double __nv_fmod(double __a, double __b)
__DEVICE__ double __nv_erfcinv(double __a)
__DEVICE__ float __nv_exp10f(float __a)
__DEVICE__ double __nv_nextafter(double __a, double __b)
__DEVICE__ float __nv_y0f(float __a)
__DEVICE__ float __nv_j1f(float __a)
__DEVICE__ float __nv_fast_cosf(float __a)
__DEVICE__ double __nv_rhypot(double __a, double __b)
__DEVICE__ double __nv_rcbrt(double __a)
__DEVICE__ float __nv_fmodf(float __a, float __b)
__DEVICE__ float __nv_erfcinvf(float __a)
__DEVICE__ double __nv_log10(double __a)
__DEVICE__ double __nv_pow(double __a, double __b)
__DEVICE__ double __nv_asinh(double __a)
__DEVICE__ float __nv_ldexpf(float __a, int __b)
__DEVICE__ double __nv_tgamma(double __a)
__DEVICE__ float __nv_fmaf(float __a, float __b, float __c)
__DEVICE__ double __nv_normcdf(double __a)
__DEVICE__ double __nv_y0(double __a)
__DEVICE__ float __nv_rsqrtf(float __a)
__DEVICE__ unsigned long long __nv_ullmin(unsigned long long __a, unsigned long long __b)
__DEVICE__ double __nv_fma(double __a, double __b, double __c)
__DEVICE__ float __nv_rintf(float __a)
__DEVICE__ float __nv_log10f(float __a)
__DEVICE__ double __nv_rnorm(int __a, const double *__b)
__DEVICE__ float __nv_normcdff(float __a)
__DEVICE__ double __nv_erfc(double __a)
__DEVICE__ double __nv_sinh(double __a)
__DEVICE__ void __nv_sincospi(double __a, double *__b, double *__c)
__DEVICE__ float __nv_remainderf(float __a, float __b)
__DEVICE__ double __nv_logb(double __a)
__DEVICE__ float __nv_ceilf(float __a)
__DEVICE__ double __nv_lgamma(double __a)
__DEVICE__ float __nv_modff(float __a, float *__b)
__DEVICE__ float __nv_fdimf(float __a, float __b)
__DEVICE__ double __nv_erfcx(double __a)
__DEVICE__ float __nv_ynf(int __a, float __b)
__DEVICE__ double __nv_acos(double __a)
__DEVICE__ float __nv_hypotf(float __a, float __b)
__DEVICE__ int __nv_max(int __a, int __b)
__DEVICE__ double __nv_atan2(double __a, double __b)
__DEVICE__ unsigned long long __nv_ullmax(unsigned long long __a, unsigned long long __b)
__DEVICE__ double __nv_cosh(double __a)
__DEVICE__ float __nv_normf(int __a, const float *__b)
__DEVICE__ double __nv_cbrt(double __a)
__DEVICE__ double __nv_cospi(double __a)
__DEVICE__ double __nv_yn(int __a, double __b)
__DEVICE__ double __nv_copysign(double __a, double __b)
__DEVICE__ float __nv_fast_fdividef(float __a, float __b)
__DEVICE__ double __nv_j1(double __a)
__DEVICE__ float __nv_nearbyintf(float __a)
__DEVICE__ double __nv_scalbn(double __a, int __b)
__DEVICE__ double __nv_fabs(double __a)
__DEVICE__ float __nv_log2f(float __a)
__DEVICE__ double __nv_exp10(double __a)
__DEVICE__ float __nv_floorf(float __a)
__DEVICE__ float __nv_erff(float __a)
__DEVICE__ float __nv_cbrtf(float __a)
__DEVICE__ double __nv_cyl_bessel_i1(double __a)
__DEVICE__ double __nv_cos(double __a)
__DEVICE__ float __nv_exp2f(float __a)
__DEVICE__ double __nv_j0(double __a)
__DEVICE__ float __nv_fast_log2f(float __a)
__DEVICE__ double __nv_floor(double __a)
__DEVICE__ float __nv_fminf(float __a, float __b)
__DEVICE__ double __nv_exp2(double __a)
__DEVICE__ double __nv_erfinv(double __a)
__DEVICE__ float __nv_roundf(float __a)
__DEVICE__ double __nv_erf(double __a)
__DEVICE__ double __nv_round(double __a)
__DEVICE__ float __nv_rnorm3df(float __a, float __b, float __c)
__DEVICE__ float __nv_norm4df(float __a, float __b, float __c, float __d)
__DEVICE__ long long __nv_llmax(long long __a, long long __b)
__DEVICE__ double __nv_ldexp(double __a, int __b)
__DEVICE__ double __nv_normcdfinv(double __a)
__DEVICE__ long long __nv_llmin(long long __a, long long __b)
__DEVICE__ float __nv_rcbrtf(float __a)
__DEVICE__ float __nv_erfcxf(float __a)
__DEVICE__ double __nv_atan(double __a)
__DEVICE__ double __nv_tan(double __a)
__DEVICE__ void __nv_fast_sincosf(float __a, float *__s, float *__c)
__DEVICE__ double __nv_tanh(double __a)
__DEVICE__ void __nv_sincospif(float __a, float *__b, float *__c)
__DEVICE__ float __nv_powf(float __a, float __b)
__DEVICE__ float __nv_lgammaf(float __a)
__DEVICE__ float __nv_cospif(float __a)
__DEVICE__ float __nv_cyl_bessel_i0f(float __a)
__DEVICE__ double __nv_rsqrt(double __a)
__DEVICE__ double __nv_atanh(double __a)
__DEVICE__ double __nv_rnorm3d(double __a, double __b, double __c)
__DEVICE__ float __nv_cyl_bessel_i1f(float __a)
__DEVICE__ float __nv_atan2f(float __a, float __b)
__DEVICE__ float __nv_jnf(int __a, float __b)
__DEVICE__ int __nv_abs(int __a)
__DEVICE__ double __nv_frexp(double __a, int *__b)
__DEVICE__ float __nv_sinpif(float __a)
__DEVICE__ double __nv_fmin(double __a, double __b)
__DEVICE__ double __nv_expm1(double __a)
__DEVICE__ double __nv_cyl_bessel_i0(double __a)
__DEVICE__ int __nv_min(int __a, int __b)
__DEVICE__ float __nv_erfcf(float __a)
__DEVICE__ double __nv_jn(int __a, double __b)
__DEVICE__ float __nv_fast_logf(float __a)
__DEVICE__ unsigned int __nv_umax(unsigned int __a, unsigned int __b)
__DEVICE__ float __nv_norm3df(float __a, float __b, float __c)
__DEVICE__ double __nv_modf(double __a, double *__b)
__DEVICE__ double __nv_sqrt(double __a)
__DEVICE__ double __nv_asin(double __a)
__DEVICE__ float __nv_asinhf(float __a)
__DEVICE__ float __nv_y1f(float __a)
__DEVICE__ double __nv_ceil(double __a)
__DEVICE__ int __nv_ilogb(double __a)
__DEVICE__ void __nv_sincosf(float __a, float *__b, float *__c)
__DEVICE__ float __nv_rnorm4df(float __a, float __b, float __c, float __d)
__DEVICE__ float __nv_asinf(float __a)
__DEVICE__ double __nv_exp(double __a)
__DEVICE__ float __nv_truncf(float __a)
__DEVICE__ float __nv_fmaxf(float __a, float __b)
__DEVICE__ float __nv_cosf(float __a)
__DEVICE__ long long __nv_llroundf(float __a)
__DEVICE__ float __nv_acoshf(float __a)
__DEVICE__ float __nv_sinf(float __a)
__DEVICE__ float __nv_atanhf(float __a)
__DEVICE__ double __nv_rint(double __a)
__DEVICE__ void __nv_sincos(double __a, double *__b, double *__c)
__DEVICE__ float __nv_coshf(float __a)
__DEVICE__ double __nv_powi(double __a, int __b)
__DEVICE__ float __nv_log1pf(float __a)
__DEVICE__ long long __nv_llrintf(float __a)
__DEVICE__ float __nv_normcdfinvf(float __a)
__DEVICE__ float __nv_scalbnf(float __a, int __b)
__DEVICE__ float __nv_acosf(float __a)
__DEVICE__ double __nv_trunc(double __a)
__DEVICE__ float __nv_expf(float __a)
__DEVICE__ float __nv_rnormf(int __a, const float *__b)
__DEVICE__ float __nv_j0f(float __a)
__DEVICE__ float __nv_erfinvf(float __a)
__DEVICE__ double __nv_rnorm4d(double __a, double __b, double __c, double __d)
__DEVICE__ double __nv_norm4d(double __a, double __b, double __c, double __d)
__DEVICE__ double __nv_norm3d(double __a, double __b, double __c)
__DEVICE__ float __nv_logf(float __a)
__DEVICE__ float __nv_atanf(float __a)
__DEVICE__ float __nv_tanf(float __a)
__DEVICE__ double __nv_norm(int __a, const double *__b)
__DEVICE__ double __nv_log1p(double __a)
__DEVICE__ long long __nv_llabs(long long __a)
__DEVICE__ float __nv_tgammaf(float __a)
__DEVICE__ float __nv_sqrtf(float __a)
__DEVICE__ double __nv_hypot(double __a, double __b)
__DEVICE__ double __nv_y1(double __a)
__DEVICE__ float __nv_rhypotf(float __a, float __b)
__DEVICE__ float __nv_remquof(float __a, float __b, int *__c)
__DEVICE__ double __nv_sin(double __a)
__DEVICE__ double __nv_fdim(double __a, double __b)
__DEVICE__ double __nv_remquo(double __a, double __b, int *__c)
__DEVICE__ int __nv_ilogbf(float __a)
__DEVICE__ float __nv_sinhf(float __a)
__DEVICE__ double __nv_nearbyint(double __a)
__DEVICE__ unsigned int __nv_umin(unsigned int __a, unsigned int __b)
__DEVICE__ float __nv_copysignf(float __a, float __b)
__DEVICE__ float __nv_frexpf(float __a, int *__b)
__DEVICE__ float __nv_powif(float __a, int __b)
__DEVICE__ float __nv_logbf(float __a)
__DEVICE__ float __nv_fast_sinf(float __a)
__DEVICE__ double __nv_fmax(double __a, double __b)
__DEVICE__ long long __nv_llround(double __a)
__DEVICE__ float y0f(float __a)
__DEVICE__ double powi(double __a, int __b)
__DEVICE__ double acos(double __a)
__DEVICE__ float fabsf(float __a)
__DEVICE__ double rhypot(double __a, double __b)
__DEVICE__ float fmodf(float __a, float __b)
__DEVICE__ double y1(double __a)
__DEVICE__ double hypot(double __a, double __b)
__DEVICE__ float remainderf(float __a, float __b)
__DEVICE__ double fma(double __a, double __b, double __c)
__DEVICE__ float exp2f(float __a)
__DEVICE__ double j0(double __a)
__DEVICE__ float rsqrtf(float __a)
__DEVICE__ float acosf(float __a)
__DEVICE__ float fmaf(float __a, float __b, float __c)
__DEVICE__ double tan(double __a)
__DEVICE__ double cos(double __a)
__DEVICE__ double scalbln(double __a, long __b)
__DEVICE__ long lrint(double __a)
__DEVICE__ float cbrtf(float __a)
__DEVICE__ float cyl_bessel_i1f(float __a)
__DEVICE__ double nearbyint(double __a)
__DEVICE__ float remquof(float __a, float __b, int *__c)
__DEVICE__ float tanf(float __a)
__DEVICE__ long labs(long __a)
__DEVICE__ float nextafterf(float __a, float __b)
__DEVICE__ double ceil(double __a)
__DEVICE__ float fmaxf(float __a, float __b)
__DEVICE__ double fmax(double __a, double __b)
__DEVICE__ double atan2(double __a, double __b)
__DEVICE__ double cosh(double __a)
__DEVICE__ double fmod(double __a, double __b)
__DEVICE__ double nextafter(double __a, double __b)
__DEVICE__ long long llabs(long long __a)
__DEVICE__ float fminf(float __a, float __b)
__DEVICE__ float log2f(float __a)
__DEVICE__ long long llround(double __a)
__DEVICE_VOID__ void sincos(double __a, double *__s, double *__c)
__DEVICE__ long lround(double __a)
__DEVICE__ double acosh(double __a)
__DEVICE__ double normcdf(double __a)
__DEVICE__ double atanh(double __a)
__DEVICE__ float norm3df(float __a, float __b, float __c)
__DEVICE__ float copysignf(float __a, float __b)
__DEVICE__ float truncf(float __a)
__DEVICE__ float fdimf(float __a, float __b)
__DEVICE__ double fdim(double __a, double __b)
__DEVICE_VOID__ void sincospi(double __a, double *__s, double *__c)
__DEVICE__ float rcbrtf(float __a)
__DEVICE__ long lrintf(float __a)
__DEVICE__ long long llrintf(float __a)
__DEVICE__ float j1f(float __a)
__DEVICE__ double erfinv(double __a)
__DEVICE__ double atan(double __a)
__DEVICE__ float cosf(float __a)
__DEVICE__ double fdivide(double __a, double __b)
__DEVICE__ float ynf(int __a, float __b)
__DEVICE__ float sinf(float __a)
__DEVICE__ float erfcinvf(float __a)
__DEVICE__ double log(double __a)
__DEVICE__ float sinpif(float __a)
__DEVICE__ double floor(double __f)
__DEVICE__ float logf(float __a)
__DEVICE__ double lgamma(double __a)
__DEVICE__ double exp2(double __a)
__DEVICE__ double log10(double __a)
__DEVICE__ float erfinvf(float __a)
__DEVICE__ float erff(float __a)
__DEVICE_VOID__ void sincospif(float __a, float *__s, float *__c)
__DEVICE__ double asin(double __a)
__DEVICE__ float floorf(float __f)
__DEVICE__ double logb(double __a)
__DEVICE__ float ceilf(float __a)
__DEVICE__ double copysign(double __a, double __b)
__DEVICE__ float nearbyintf(float __a)
__DEVICE__ float atanf(float __a)
__DEVICE__ float rnorm4df(float __a, float __b, float __c, float __d)
__DEVICE__ float atanhf(float __a)
__DEVICE__ long long llmin(long long __a, long long __b)
__DEVICE__ int min(int __a, int __b)
__DEVICE__ float tanhf(float __a)
__DEVICE__ double rnorm4d(double __a, double __b, double __c, double __d)
__DEVICE__ long long llmax(long long __a, long long __b)
__DEVICE__ float rhypotf(float __a, float __b)
__DEVICE__ double yn(int __a, double __b)
__DEVICE__ float exp10f(float __a)
__DEVICE__ float normf(int __dim, const float *__t)
__DEVICE__ double rcbrt(double __a)
__DEVICE__ float rintf(float __a)
__DEVICE__ float atan2f(float __a, float __b)
__DEVICE__ float sinhf(float __a)
__DEVICE__ unsigned long long ullmin(unsigned long long __a, unsigned long long __b)
__DEVICE__ double exp(double __a)
__DEVICE__ double erf(double __a)
__DEVICE__ double cyl_bessel_i1(double __a)
__DEVICE__ float acoshf(float __a)
__DEVICE__ unsigned long long ullmax(unsigned long long __a, unsigned long long __b)
__DEVICE__ double y0(double __a)
__DEVICE__ double cyl_bessel_i0(double __a)
__DEVICE__ float log10f(float __a)
__DEVICE__ int abs(int __a)
__DEVICE__ float ldexpf(float __a, int __b)
#define __FAST_OR_SLOW(fast, slow)
__DEVICE__ double norm(int __dim, const double *__t)
__DEVICE__ double log1p(double __a)
__DEVICE__ float normcdff(float __a)
__DEVICE__ double expm1(double __a)
__DEVICE__ double cospi(double __a)
__DEVICE__ int ilogb(double __a)
__DEVICE__ double sinpi(double __a)
__DEVICE__ float modff(float __a, float *__b)
__DEVICE__ float erfcxf(float __a)
__DEVICE__ double fmin(double __a, double __b)
__DEVICE__ double sqrt(double __a)
__DEVICE__ float logbf(float __a)
__DEVICE__ float normcdfinvf(float __a)
__DEVICE__ double pow(double __a, double __b)
__DEVICE__ double normcdfinv(double __a)
__DEVICE__ double trunc(double __a)
__DEVICE__ float cyl_bessel_i0f(float __a)
__DEVICE__ float powif(float __a, int __b)
__DEVICE__ double ldexp(double __a, int __b)
__DEVICE__ float coshf(float __a)
__DEVICE__ float asinhf(float __a)
__DEVICE__ float roundf(float __a)
__DEVICE__ double remainder(double __a, double __b)
__DEVICE__ long lroundf(float __a)
__DEVICE__ float norm4df(float __a, float __b, float __c, float __d)
__DEVICE__ float scalbnf(float __a, int __b)
__DEVICE__ double j1(double __a)
__DEVICE__ long long llrint(double __a)
__DEVICE__ float erfcf(float __a)
__DEVICE__ double modf(double __a, double *__b)
__DEVICE__ int ilogbf(float __a)
__DEVICE__ double fabs(double __a)
__DEVICE__ double norm3d(double __a, double __b, double __c)
__DEVICE__ float powf(float __a, float __b)
__DEVICE__ double round(double __a)
__DEVICE__ double rint(double __a)
__DEVICE__ double norm4d(double __a, double __b, double __c, double __d)
__DEVICE__ double remquo(double __a, double __b, int *__c)
__DEVICE__ double tgamma(double __a)
__DEVICE__ double asinh(double __a)
__DEVICE__ double scalbn(double __a, int __b)
__DEVICE__ unsigned int umin(unsigned int __a, unsigned int __b)
__DEVICE__ float jnf(int __n, float __a)
__DEVICE__ float rnorm3df(float __a, float __b, float __c)
__DEVICE__ float cospif(float __a)
__DEVICE__ float frexpf(float __a, int *__b)
__DEVICE__ double sinh(double __a)
__DEVICE__ double erfcx(double __a)
__DEVICE__ float rnormf(int __dim, const float *__t)
__DEVICE__ double erfc(double __a)
__DEVICE__ float sqrtf(float __a)
__DEVICE__ unsigned int umax(unsigned int __a, unsigned int __b)
__DEVICE__ int max(int __a, int __b)
__DEVICE_VOID__ void sincosf(float __a, float *__s, float *__c)
__DEVICE__ double frexp(double __a, int *__b)
__DEVICE__ double exp10(double __a)
__DEVICE__ double log2(double __a)
__DEVICE__ double cbrt(double __a)
__DEVICE__ float fdividef(float __a, float __b)
__DEVICE__ float expf(float __a)
__DEVICE__ float expm1f(float __a)
__DEVICE__ double sin(double __a)
__DEVICE__ float scalblnf(float __a, long __b)
__DEVICE__ double tanh(double __a)
__DEVICE__ float tgammaf(float __a)
__DEVICE__ double rsqrt(double __a)
__DEVICE__ float log1pf(float __a)
__DEVICE__ float lgammaf(float __a)
__DEVICE__ float y1f(float __a)
__DEVICE__ long long llroundf(float __a)
__DEVICE__ double jn(int __n, double __a)
__DEVICE__ double rnorm3d(double __a, double __b, double __c)
__DEVICE__ float hypotf(float __a, float __b)
__DEVICE__ double rnorm(int __a, const double *__b)
__DEVICE__ double erfcinv(double __a)
__DEVICE__ float j0f(float __a)
__DEVICE__ float asinf(float __a)
static __inline__ vector float vector float vector float __c
static __inline__ vector float vector float __b
static __inline__ void int __a
#define HUGE_VALF
A positive float constant expression.
#define HUGE_VAL
A positive double constant expression.