23 #ifndef __CLANG_CUDA_CMATH_H__
24 #define __CLANG_CUDA_CMATH_H__
26 #error "This file is for CUDA compilation only."
45 #define __DEVICE__ static __device__ __inline__ __attribute__((always_inline))
63 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
67 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
71 return ::frexpf(__arg, __exp);
78 return __builtin_isgreater(__x, __y);
81 return __builtin_isgreater(__x, __y);
84 return __builtin_isgreaterequal(__x, __y);
87 return __builtin_isgreaterequal(__x, __y);
90 return __builtin_isless(__x, __y);
93 return __builtin_isless(__x, __y);
96 return __builtin_islessequal(__x, __y);
99 return __builtin_islessequal(__x, __y);
102 return __builtin_islessgreater(__x, __y);
105 return __builtin_islessgreater(__x, __y);
112 return __builtin_isunordered(__x, __y);
115 return __builtin_isunordered(__x, __y);
118 return ::ldexpf(__arg, __exp);
124 return __builtin_nexttowardf(__from, __to);
127 return __builtin_nexttoward(__from, __to);
130 return ::powf(__base, __exp);
133 return ::powif(__base, __iexp);
136 return ::powi(__base, __iexp);
static __inline unsigned char unsigned int unsigned int __y
__DEVICE__ bool signbit(float __x)
Test for sign bit.
__DEVICE__ float sinh(float __x)
Compute hyperbolic sine.
__DEVICE__ float atan2(float __x, float __y)
Arc tangent of y / x.
__DEVICE__ long long abs(long long __n)
__DEVICE__ float floor(float __x)
Round to integral value using the round to -ve infinity rounding mode.
__DEVICE__ float sqrt(float __x)
Compute square root.
__DEVICE__ float modf(float __x, float *__iptr)
Decompose a floating-point number.
__DEVICE__ float asin(float __x)
Arc sine function.
__DEVICE__ float ceil(float __x)
Round to integral value using the round to positive infinity rounding mode.
__DEVICE__ bool isinf(float __x)
Test for infinity value (+ve or -ve) .
__DEVICE__ float acos(float __x)
Arc cosine function.
__DEVICE__ float log(float __x)
Compute natural logarithm.
__DEVICE__ int fpclassify(float __x)
__DEVICE__ float sin(float __x)
Compute sine.
__DEVICE__ long labs(long)
__DEVICE__ bool isfinite(float __x)
Test for finite value.
__DEVICE__ float fmod(float __x, float __y)
Modulus.
__DEVICE__ float tan(float __x)
Compute tangent.
__DEVICE__ bool islessequal(float __x, float __y)
Returns the component-wise compare of x <= y.
__DEVICE__ float ldexp(float __arg, int __exp)
Multiply x by 2 to the power n.
__DEVICE__ float fabs(float __x)
Compute absolute value of a floating-point number.
__DEVICE__ bool isunordered(float __x, float __y)
Test if arguments are unordered.
__DEVICE__ float frexp(float __arg, int *__exp)
Extract mantissa and exponent from x.
static __inline unsigned char unsigned int __x
__DEVICE__ bool isgreaterequal(float __x, float __y)
Returns the component-wise compare of x >= y.
__DEVICE__ float cos(float __x)
Compute cosine.
__DEVICE__ float log10(float __x)
Compute a base 10 logarithm.
__DEVICE__ bool isnan(float __x)
Test for a NaN.
__DEVICE__ bool isgreater(float __x, float __y)
Returns the component-wise compare of x > y.
__DEVICE__ float atan(float __x)
Arc tangent function.
__DEVICE__ bool islessgreater(float __x, float __y)
Returns the component-wise compare of (x < y) || (x > y) .
__DEVICE__ float nexttoward(float __from, float __to)
__DEVICE__ long long llabs(long long)
__DEVICE__ float cosh(float __x)
Compute hyperbolic cosine.
__DEVICE__ float pow(float __base, float __exp)
Compute x to the power y.
__DEVICE__ bool isless(float __x, float __y)
Returns the component-wise compare of x < y.
__DEVICE__ float tanh(float __x)
Compute hyperbolic tangent.
__DEVICE__ float exp(float __x)
Compute the base e exponential function of x.
__DEVICE__ bool isnormal(float __x)
Test for a normal value.