This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

Single Precision Floating-point Intrinsics

Single Precision Floating-point Intrinsics#

HIP Runtime API Reference: Single Precision Floating-point Intrinsics
Single Precision Floating-point Intrinsics
Collaboration diagram for Single Precision Floating-point Intrinsics:

Functions

__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...
 

Detailed Description

Single Precision Floating-point Intrinsics

Function Documentation

◆ __cosf()

__DEVICE__ float __cosf ( float  __x)

Returns the fast approximate cosine of x.

◆ __exp10f()

__DEVICE__ float __exp10f ( float  __x)

Returns the fast approximate for \( 10^x \).

◆ __expf()

__DEVICE__ float __expf ( float  __x)

Returns the fast approximate for \( e^x \).

◆ __fadd_rn()

__DEVICE__ float __fadd_rn ( float  __x,
float  __y 
)

Add two floating-point values in round-to-nearest-even mode.

◆ __fdiv_rn()

__DEVICE__ float __fdiv_rn ( float  __x,
float  __y 
)

Divide two floating-point values in round-to-nearest-even mode.

◆ __fdividef()

__DEVICE__ float __fdividef ( float  __x,
float  __y 
)

Returns the fast approximate of x / y.

◆ __fmaf_rn()

__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.

◆ __fmul_rn()

__DEVICE__ float __fmul_rn ( float  __x,
float  __y 
)

Multiply two floating-point values in round-to-nearest-even mode.

◆ __frcp_rn()

__DEVICE__ float __frcp_rn ( float  __x)

Returns 1 / x in round-to-nearest-even mod.

◆ __frsqrt_rn()

__DEVICE__ float __frsqrt_rn ( float  __x)

Returns \( 1 / \sqrt{x}\) in round-to-nearest-even mode.

◆ __fsqrt_rn()

__DEVICE__ float __fsqrt_rn ( float  __x)

Returns \(\sqrt{x}\) in round-to-nearest-even mode.

◆ __fsub_rn()

__DEVICE__ float __fsub_rn ( float  __x,
float  __y 
)

Subtract two floating-point values in round-to-nearest-even mode.

◆ __log10f()

__DEVICE__ float __log10f ( float  __x)

Returns the fast approximate for base 10 logarithm of x.

◆ __log2f()

__DEVICE__ float __log2f ( float  __x)

Returns the fast approximate for base 2 logarithm of x.

◆ __logf()

__DEVICE__ float __logf ( float  __x)

Returns the fast approximate for natural logarithm of x.

◆ __powf()

__DEVICE__ float __powf ( float  __x,
float  __y 
)

Returns the fast approximate of \( x^y \).

◆ __saturatef()

__DEVICE__ float __saturatef ( float  __x)

Clamp x to [+0.0, 1.0].

◆ __sincosf()

__DEVICE__ void __sincosf ( float  __x,
float *  __sinptr,
float *  __cosptr 
)

Returns the fast approximate of sine and cosine of x.

◆ __sinf()

__DEVICE__ float __sinf ( float  __x)

Returns the fast approximate sine of x.

◆ __tanf()

__DEVICE__ float __tanf ( float  __x)

Returns the fast approximate tangent of x.