/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/llvm-project/clang/lib/Headers/__clang_hip_math.h File Reference#

HIP Runtime API Reference: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hip/checkouts/llvm-project/clang/lib/Headers/__clang_hip_math.h File Reference
__clang_hip_math.h File Reference
#include <limits.h>
#include <stdint.h>
Include dependency graph for __clang_hip_math.h:

Go to the source code of this file.

Macros

#define __DEVICE__   static __device__ inline __attribute__((always_inline))
 
#define __FAST_OR_SLOW(fast, slow)   slow
 
#define __RETURN_TYPE   int
 
#define __static_assert_type_size_equal(A, B)    static_assert((A) == (B), "")
 

Functions

__DEVICE__ uint64_t __make_mantissa_base8 (const char *__tagp __attribute__((nonnull)))
 Make base 8 (octal) mantissa from char array. More...
 
__DEVICE__ uint64_t __make_mantissa_base10 (const char *__tagp __attribute__((nonnull)))
 Make base 10 (decimal) mantissa char array. More...
 
__DEVICE__ uint64_t __make_mantissa_base16 (const char *__tagp __attribute__((nonnull)))
 Make base 16 (hexadecimal) mantissa char array. More...
 
__DEVICE__ uint64_t __make_mantissa (const char *__tagp __attribute__((nonnull)))
 Make mantissa based on number format char array. More...
 
__DEVICE__ float __cosf (float __x)
 Returns the fast approximate cosine of x. More...
 
__DEVICE__ float __exp10f (float __x)
 Returns the fast approximate for \( 10^x \). More...
 
__DEVICE__ float __expf (float __x)
 Returns the fast approximate for \( e^x \). More...
 
__DEVICE__ float __fadd_rn (float __x, float __y)
 Add two floating-point values in round-to-nearest-even mode. More...
 
__DEVICE__ float __fdiv_rn (float __x, float __y)
 Divide two floating-point values in round-to-nearest-even mode. More...
 
__DEVICE__ float __fdividef (float __x, float __y)
 Returns the fast approximate of x / y. More...
 
__DEVICE__ float __fmaf_rn (float __x, float __y, float __z)
 Returns \(x \cdot y + z\) as a single operation, in round-to-nearest-even mode. More...
 
__DEVICE__ float __fmul_rn (float __x, float __y)
 Multiply two floating-point values in round-to-nearest-even mode. More...
 
__DEVICE__ float __frcp_rn (float __x)
 Returns 1 / x in round-to-nearest-even mod. More...
 
__DEVICE__ float __frsqrt_rn (float __x)
 Returns \( 1 / \sqrt{x}\) in round-to-nearest-even mode. More...
 
__DEVICE__ float __fsqrt_rn (float __x)
 Returns \(\sqrt{x}\) in round-to-nearest-even mode. More...
 
__DEVICE__ float __fsub_rn (float __x, float __y)
 Subtract two floating-point values in round-to-nearest-even mode. More...
 
__DEVICE__ float __log10f (float __x)
 Returns the fast approximate for base 10 logarithm of x. More...
 
__DEVICE__ float __log2f (float __x)
 Returns the fast approximate for base 2 logarithm of x. More...
 
__DEVICE__ float __logf (float __x)
 Returns the fast approximate for natural logarithm of x. More...
 
__DEVICE__ float __powf (float __x, float __y)
 Returns the fast approximate of \( x^y \). More...
 
__DEVICE__ float __saturatef (float __x)
 Clamp x to [+0.0, 1.0]. More...
 
__DEVICE__ void __sincosf (float __x, float *__sinptr, float *__cosptr)
 Returns the fast approximate of sine and cosine of x. More...
 
__DEVICE__ float __sinf (float __x)
 Returns the fast approximate sine of x. More...
 
__DEVICE__ float __tanf (float __x)
 Returns the fast approximate tangent of x. More...
 
__DEVICE__ float acosf (float __x)
 Returns the arc cosine of x. More...
 
__DEVICE__ float acoshf (float __x)
 Returns the nonnegative arc hyperbolic cosine of x. More...
 
__DEVICE__ float asinf (float __x)
 Returns the arc sine of x. More...
 
__DEVICE__ float asinhf (float __x)
 Returns the arc hyperbolic sine of x. More...
 
__DEVICE__ float atan2f (float __x, float __y)
 Returns the arc tangent of the ratio of x and y. More...
 
__DEVICE__ float atanf (float __x)
 Returns the arc tangent of x. More...
 
__DEVICE__ float atanhf (float __x)
 Returns the arc hyperbolic tangent of x. More...
 
__DEVICE__ float cbrtf (float __x)
 Returns the cube root of x. More...
 
__DEVICE__ float ceilf (float __x)
 Returns ceiling of x. More...
 
__DEVICE__ float copysignf (float __x, float __y)
 Create value with given magnitude, copying sign of second value. More...
 
__DEVICE__ float cosf (float __x)
 Returns the cosine of x. More...
 
__DEVICE__ float coshf (float __x)
 Returns the hyperbolic cosine of x. More...
 
__DEVICE__ float cospif (float __x)
 Returns the cosine of \( \pi x\). More...
 
__DEVICE__ float cyl_bessel_i0f (float __x)
 Returns the value of the regular modified cylindrical Bessel function of order 0 for x. More...
 
__DEVICE__ float cyl_bessel_i1f (float __x)
 Returns the value of the regular modified cylindrical Bessel function of order 1 for x. More...
 
__DEVICE__ float erfcf (float __x)
 Returns the complementary error function of x. More...
 
__DEVICE__ float erfcinvf (float __x)
 Returns the inverse complementary function of x. More...
 
__DEVICE__ float erfcxf (float __x)
 Returns the scaled complementary error function of x. More...
 
__DEVICE__ float erff (float __x)
 Returns the error function of x. More...
 
__DEVICE__ float erfinvf (float __x)
 Returns the inverse error function of x. More...
 
__DEVICE__ float exp10f (float __x)
 Returns \( 10^x \). More...
 
__DEVICE__ float exp2f (float __x)
 Returns \( 2^x \). More...
 
__DEVICE__ float expf (float __x)
 Returns \( e^x \). More...
 
__DEVICE__ float expm1f (float __x)
 Returns \( \ln x - 1 \). More...
 
__DEVICE__ float fabsf (float __x)
 Returns the absolute value of x More...
 
__DEVICE__ float fdimf (float __x, float __y)
 Returns the positive difference between x and y. More...
 
__DEVICE__ float fdividef (float __x, float __y)
 Divide two floating point values. More...
 
__DEVICE__ float floorf (float __x)
 Returns the largest integer less than or equal to x. More...
 
__DEVICE__ float fmaf (float __x, float __y, float __z)
 Returns \(x \cdot y + z\) as a single operation. More...
 
__DEVICE__ float fmaxf (float __x, float __y)
 Determine the maximum numeric value of x and y. More...
 
__DEVICE__ float fminf (float __x, float __y)
 Determine the minimum numeric value of x and y. More...
 
__DEVICE__ float fmodf (float __x, float __y)
 Returns the floating-point remainder of x / y. More...
 
__DEVICE__ float frexpf (float __x, int *__nptr)
 Extract mantissa and exponent of x. More...
 
__DEVICE__ float hypotf (float __x, float __y)
 Returns the square root of the sum of squares of x and y. More...
 
__DEVICE__ int ilogbf (float __x)
 Returns the unbiased integer exponent of x. More...
 
__DEVICE__ __RETURN_TYPE __finitef (float __x)
 Determine whether x is finite. More...
 
__DEVICE__ __RETURN_TYPE __isinff (float __x)
 Determine whether x is infinite. More...
 
__DEVICE__ __RETURN_TYPE __isnanf (float __x)
 Determine whether x is a NaN. More...
 
__DEVICE__ float j0f (float __x)
 Returns the value of the Bessel function of the first kind of order 0 for x. More...
 
__DEVICE__ float j1f (float __x)
 Returns the value of the Bessel function of the first kind of order 1 for x. More...
 
__DEVICE__ float jnf (int __n, float __x)
 Returns the value of the Bessel function of the first kind of order n for x. More...
 
__DEVICE__ float ldexpf (float __x, int __e)
 Returns the value of \(x \cdot 2^{e}\) for x and e. More...
 
__DEVICE__ float lgammaf (float __x)
 Returns the natural logarithm of the absolute value of the gamma function of x. More...
 
__DEVICE__ long long int llrintf (float __x)
 Round x to nearest integer value. More...
 
__DEVICE__ long long int llroundf (float __x)
 Round to nearest integer value. More...
 
__DEVICE__ float log10f (float __x)
 Returns the base 10 logarithm of x. More...
 
__DEVICE__ float log1pf (float __x)
 Returns the natural logarithm of x + 1. More...
 
__DEVICE__ float log2f (float __x)
 Returns the base 2 logarithm of x. More...
 
__DEVICE__ float logbf (float __x)
 Returns the floating point representation of the exponent of x. More...
 
__DEVICE__ float logf (float __x)
 Returns the natural logarithm of x. More...
 
__DEVICE__ long int lrintf (float __x)
 Round x to nearest integer value. More...
 
__DEVICE__ long int lroundf (float __x)
 Round to nearest integer value. More...
 
__DEVICE__ float modff (float __x, float *__iptr)
 Break down x into fractional and integral parts. More...
 
__DEVICE__ float nanf (const char *__tagp __attribute__((nonnull)))
 Returns "Not a Number" value. More...
 
__DEVICE__ float nearbyintf (float __x)
 Round x to the nearest integer. More...
 
__DEVICE__ float nextafterf (float __x, float __y)
 Returns next representable single-precision floating-point value after x. More...
 
__DEVICE__ float norm3df (float __x, float __y, float __z)
 Returns the square root of the sum of squares of x, y and z. More...
 
__DEVICE__ float norm4df (float __x, float __y, float __z, float __w)
 Returns the square root of the sum of squares of x, y, z and w. More...
 
__DEVICE__ float normcdff (float __x)
 Returns the standard normal cumulative distribution function. More...
 
__DEVICE__ float normcdfinvf (float __x)
 Returns the inverse of the standard normal cumulative distribution function. More...
 
__DEVICE__ float normf (int __dim, const float *__a)
 Returns the square root of the sum of squares of any number of coordinates. More...
 
__DEVICE__ float powf (float __x, float __y)
 Returns \( x^y \). More...
 
__DEVICE__ float powif (float __x, int __y)
 Returns the value of first argument to the power of second argument. More...
 
__DEVICE__ float rcbrtf (float __x)
 Returns the reciprocal cube root function. More...
 
__DEVICE__ float remainderf (float __x, float __y)
 Returns single-precision floating-point remainder. More...
 
__DEVICE__ float remquof (float __x, float __y, int *__quo)
 Returns single-precision floating-point remainder and part of quotient. More...
 
__DEVICE__ float rhypotf (float __x, float __y)
 Returns one over the square root of the sum of squares of x and y. More...
 
__DEVICE__ float rintf (float __x)
 Round x to nearest integer value in floating-point. More...
 
__DEVICE__ float rnorm3df (float __x, float __y, float __z)
 Returns one over the square root of the sum of squares of x, y and z. More...
 
__DEVICE__ float rnorm4df (float __x, float __y, float __z, float __w)
 Returns one over the square root of the sum of squares of x, y, z and w. More...
 
__DEVICE__ float rnormf (int __dim, const float *__a)
 Returns the reciprocal of square root of the sum of squares of any number of coordinates. More...
 
__DEVICE__ float roundf (float __x)
 Round to nearest integer value in floating-point. More...
 
__DEVICE__ float rsqrtf (float __x)
 Returns the reciprocal of the square root of x. More...
 
__DEVICE__ float scalblnf (float __x, long int __n)
 Scale x by \( 2^n \). More...
 
__DEVICE__ float scalbnf (float __x, int __n)
 Scale x by \( 2^n \). More...
 
__DEVICE__ __RETURN_TYPE __signbitf (float __x)
 Return the sign bit of x. More...
 
__DEVICE__ void sincosf (float __x, float *__sinptr, float *__cosptr)
 Returns the sine and cosine of x. More...
 
__DEVICE__ void sincospif (float __x, float *__sinptr, float *__cosptr)
 Returns the sine and cosine of \( \pi x\). More...
 
__DEVICE__ float sinf (float __x)
 Returns the sine of x. More...
 
__DEVICE__ float sinhf (float __x)
 Returns the hyperbolic sine of x. More...
 
__DEVICE__ float sinpif (float __x)
 Returns the hyperbolic sine of \( \pi x\). More...
 
__DEVICE__ float sqrtf (float __x)
 Returns the square root of x. More...
 
__DEVICE__ float tanf (float __x)
 Returns the tangent of x. More...
 
__DEVICE__ float tanhf (float __x)
 Returns the hyperbolic tangent of x. More...
 
__DEVICE__ float tgammaf (float __x)
 Returns the gamma function of x. More...
 
__DEVICE__ float truncf (float __x)
 Truncate x to the integral part. More...
 
__DEVICE__ float y0f (float __x)
 Returns the value of the Bessel function of the second kind of order 0 for x. More...
 
__DEVICE__ float y1f (float __x)
 Returns the value of the Bessel function of the second kind of order 1 for x. More...
 
__DEVICE__ float ynf (int __n, float __x)
 Returns the value of the Bessel function of the second kind of order n for x. More...
 
__DEVICE__ double acos (double __x)
 Returns the arc cosine of x. More...
 
__DEVICE__ double acosh (double __x)
 Returns the nonnegative arc hyperbolic cosine of x. More...
 
__DEVICE__ double asin (double __x)
 Returns the arc sine of x. More...
 
__DEVICE__ double asinh (double __x)
 Returns the arc hyperbolic sine of x. More...
 
__DEVICE__ double atan (double __x)
 Returns the arc tangent of x. More...
 
__DEVICE__ double atan2 (double __x, double __y)
 Returns the arc tangent of the ratio of x and y. More...
 
__DEVICE__ double atanh (double __x)
 Returns the arc hyperbolic tangent of x. More...
 
__DEVICE__ double cbrt (double __x)
 Returns the cube root of x. More...
 
__DEVICE__ double ceil (double __x)
 Returns ceiling of x. More...
 
__DEVICE__ double copysign (double __x, double __y)
 Create value with given magnitude, copying sign of second value. More...
 
__DEVICE__ double cos (double __x)
 Returns the cosine of x. More...
 
__DEVICE__ double cosh (double __x)
 Returns the hyperbolic cosine of x. More...
 
__DEVICE__ double cospi (double __x)
 Returns the cosine of \( x\pi\). More...
 
__DEVICE__ double cyl_bessel_i0 (double __x)
 Returns the value of the regular modified cylindrical Bessel function of order 0 for x. More...
 
__DEVICE__ double cyl_bessel_i1 (double __x)
 Returns the value of the regular modified cylindrical Bessel function of order 1 for x. More...
 
__DEVICE__ double erf (double __x)
 Returns the error function of x. More...
 
__DEVICE__ double erfc (double __x)
 Returns the complementary error function of x. More...
 
__DEVICE__ double erfcinv (double __x)
 Returns the inverse complementary function of x. More...
 
__DEVICE__ double erfcx (double __x)
 Returns the scaled complementary error function of x. More...
 
__DEVICE__ double erfinv (double __x)
 Returns the inverse error function of x. More...
 
__DEVICE__ double exp (double __x)
 Returns \( e^x \). More...
 
__DEVICE__ double exp10 (double __x)
 Returns \( 10^x \). More...
 
__DEVICE__ double exp2 (double __x)
 Returns \( 2^x \). More...
 
__DEVICE__ double expm1 (double __x)
 Returns \( e^x -1\) for x. More...
 
__DEVICE__ double fabs (double __x)
 Returns the absolute value of x. More...
 
__DEVICE__ double fdim (double __x, double __y)
 Returns the positive difference between x and y. More...
 
__DEVICE__ double floor (double __x)
 Returns the largest integer less than or equal to x. More...
 
__DEVICE__ double fma (double __x, double __y, double __z)
 Returns \(x \cdot y + z\) as a single operation. More...
 
__DEVICE__ double fmax (double __x, double __y)
 Determine the maximum numeric value of x and y. More...
 
__DEVICE__ double fmin (double __x, double __y)
 Determine the minimum numeric value of x and y. More...
 
__DEVICE__ double fmod (double __x, double __y)
 Returns the floating-point remainder of x / y. More...
 
__DEVICE__ double frexp (double __x, int *__nptr)
 Extract mantissa and exponent of x. More...
 
__DEVICE__ double hypot (double __x, double __y)
 Returns the square root of the sum of squares of x and y. More...
 
__DEVICE__ int ilogb (double __x)
 Returns the unbiased integer exponent of x. More...
 
__DEVICE__ __RETURN_TYPE __finite (double __x)
 Determine whether x is finite. More...
 
__DEVICE__ __RETURN_TYPE __isinf (double __x)
 Determine whether x is infinite. More...
 
__DEVICE__ __RETURN_TYPE __isnan (double __x)
 Determine whether x is a NaN. More...
 
__DEVICE__ double j0 (double __x)
 Returns the value of the Bessel function of the first kind of order 0 for x. More...
 
__DEVICE__ double j1 (double __x)
 Returns the value of the Bessel function of the first kind of order 1 for x. More...
 
__DEVICE__ double jn (int __n, double __x)
 Returns the value of the Bessel function of the first kind of order n for x. More...
 
__DEVICE__ double ldexp (double __x, int __e)
 Returns the value of \(x \cdot 2^{e}\) for x and e. More...
 
__DEVICE__ double lgamma (double __x)
 Returns the natural logarithm of the absolute value of the gamma function of x. More...
 
__DEVICE__ long long int llrint (double __x)
 Round x to nearest integer value. More...
 
__DEVICE__ long long int llround (double __x)
 Round to nearest integer value. More...
 
__DEVICE__ double log (double __x)
 Returns the natural logarithm of x. More...
 
__DEVICE__ double log10 (double __x)
 Returns the base 10 logarithm of x. More...
 
__DEVICE__ double log1p (double __x)
 Returns the natural logarithm of x + 1. More...
 
__DEVICE__ double log2 (double __x)
 Returns the base 2 logarithm of x. More...
 
__DEVICE__ double logb (double __x)
 Returns the floating point representation of the exponent of x. More...
 
__DEVICE__ long int lrint (double __x)
 Round x to nearest integer value. More...
 
__DEVICE__ long int lround (double __x)
 Round to nearest integer value. More...
 
__DEVICE__ double modf (double __x, double *__iptr)
 Break down x into fractional and integral parts. More...
 
__DEVICE__ double nan (const char *__tagp)
 Returns "Not a Number" value. More...
 
__DEVICE__ double nearbyint (double __x)
 Round x to the nearest integer. More...
 
__DEVICE__ double nextafter (double __x, double __y)
 Returns next representable single-precision floating-point value after x. More...
 
__DEVICE__ double norm (int __dim, const double *__a)
 Returns the square root of the sum of squares of any number of coordinates. More...
 
__DEVICE__ double norm3d (double __x, double __y, double __z)
 Returns the square root of the sum of squares of x, y and z. More...
 
__DEVICE__ double norm4d (double __x, double __y, double __z, double __w)
 Returns the square root of the sum of squares of x, y, z and w. More...
 
__DEVICE__ double normcdf (double __x)
 Returns the standard normal cumulative distribution function. More...
 
__DEVICE__ double normcdfinv (double __x)
 Returns the inverse of the standard normal cumulative distribution function. More...
 
__DEVICE__ double pow (double __x, double __y)
 Returns \( x^y \). More...
 
__DEVICE__ double powi (double __x, int __y)
 Returns the value of first argument to the power of second argument. More...
 
__DEVICE__ double rcbrt (double __x)
 Returns the reciprocal cube root function. More...
 
__DEVICE__ double remainder (double __x, double __y)
 Returns double-precision floating-point remainder. More...
 
__DEVICE__ double remquo (double __x, double __y, int *__quo)
 Returns double-precision floating-point remainder and part of quotient. More...
 
__DEVICE__ double rhypot (double __x, double __y)
 Returns one over the square root of the sum of squares of x and y. More...
 
__DEVICE__ double rint (double __x)
 Round x to nearest integer value in floating-point. More...
 
__DEVICE__ double rnorm (int __dim, const double *__a)
 Returns the reciprocal of square root of the sum of squares of any number of coordinates. More...
 
__DEVICE__ double rnorm3d (double __x, double __y, double __z)
 Returns one over the square root of the sum of squares of x, y and z. More...
 
__DEVICE__ double rnorm4d (double __x, double __y, double __z, double __w)
 Returns one over the square root of the sum of squares of x, y, z and w. More...
 
__DEVICE__ double round (double __x)
 Round to nearest integer value in floating-point. More...
 
__DEVICE__ double rsqrt (double __x)
 Returns the reciprocal of the square root of x. More...
 
__DEVICE__ double scalbln (double __x, long int __n)
 Scale x by \( 2^n \). More...
 
__DEVICE__ double scalbn (double __x, int __n)
 Scale x by \( 2^n \). More...
 
__DEVICE__ __RETURN_TYPE __signbit (double __x)
 Return the sign bit of x. More...
 
__DEVICE__ double sin (double __x)
 Returns the sine of x. More...
 
__DEVICE__ void sincos (double __x, double *__sinptr, double *__cosptr)
 Returns the sine and cosine of x. More...
 
__DEVICE__ void sincospi (double __x, double *__sinptr, double *__cosptr)
 Returns the sine and cosine of \( \pi x\). More...
 
__DEVICE__ double sinh (double __x)
 Returns the hyperbolic sine of x. More...
 
__DEVICE__ double sinpi (double __x)
 Returns the hyperbolic sine of \( \pi x\). More...
 
__DEVICE__ double sqrt (double __x)
 Returns the square root of x. More...
 
__DEVICE__ double tan (double __x)
 Returns the tangent of x. More...
 
__DEVICE__ double tanh (double __x)
 Returns the hyperbolic tangent of x. More...
 
__DEVICE__ double tgamma (double __x)
 Returns the gamma function of x. More...
 
__DEVICE__ double trunc (double __x)
 Truncate x to the integral part. More...
 
__DEVICE__ double y0 (double __x)
 Returns the value of the Bessel function of the second kind of order 0 for x. More...
 
__DEVICE__ double y1 (double __x)
 Returns the value of the Bessel function of the second kind of order 1 for x. More...
 
__DEVICE__ double yn (int __n, double __x)
 Returns the value of the Bessel function of the second kind of order n for x. More...
 
__DEVICE__ double __dadd_rn (double __x, double __y)
 Add two floating-point values in round-to-nearest-even mode. More...
 
__DEVICE__ double __ddiv_rn (double __x, double __y)
 Divide two floating-point values in round-to-nearest-even mode. More...
 
__DEVICE__ double __dmul_rn (double __x, double __y)
 Multiply two floating-point values in round-to-nearest-even mode. More...
 
__DEVICE__ double __drcp_rn (double __x)
 Returns 1 / x in round-to-nearest-even mode. More...
 
__DEVICE__ double __dsqrt_rn (double __x)
 Returns \(\sqrt{x}\) in round-to-nearest-even mode. More...
 
__DEVICE__ double __dsub_rn (double __x, double __y)
 Subtract two floating-point values in round-to-nearest-even mode. More...
 
__DEVICE__ double __fma_rn (double __x, double __y, double __z)
 Returns \(x \cdot y + z\) as a single operation in round-to-nearest-even mode. More...
 

Macro Definition Documentation

◆ __DEVICE__

#define __DEVICE__   static __device__ inline __attribute__((always_inline))

◆ __FAST_OR_SLOW

#define __FAST_OR_SLOW (   fast,
  slow 
)    slow

◆ __RETURN_TYPE

#define __RETURN_TYPE   int

◆ __static_assert_type_size_equal

#define __static_assert_type_size_equal (   A,
 
)     static_assert((A) == (B), "")