1.1.6. Half Math Functions

[Half Precision Intrinsics]

Functions

__device__ ​ __half hceil ( const __half h )
Calculate ceiling of the input argument.
__device__ ​ __half hcos ( const __half a )
Calculates half cosine in round-to-nearest-even mode.
__device__ ​ __half hexp ( const __half a )
Calculates half natural exponential function in round-to-nearest mode.
__device__ ​ __half hexp10 ( const __half a )
Calculates half decimal exponential function in round-to-nearest mode.
__device__ ​ __half hexp2 ( const __half a )
Calculates half binary exponential function in round-to-nearest mode.
__device__ ​ __half hfloor ( const __half h )
Calculate the largest integer less than or equal to h.
__device__ ​ __half hlog ( const __half a )
Calculates half natural logarithm in round-to-nearest-even mode.
__device__ ​ __half hlog10 ( const __half a )
Calculates half decimal logarithm in round-to-nearest-even mode.
__device__ ​ __half hlog2 ( const __half a )
Calculates half binary logarithm in round-to-nearest-even mode.
__device__ ​ __half hrcp ( const __half a )
Calculates half reciprocal in round-to-nearest-even mode.
__device__ ​ __half hrint ( const __half h )
Round input to nearest integer value in half-precision floating point number.
__device__ ​ __half hrsqrt ( const __half a )
Calculates half reciprocal square root in round-to-nearest-even mode.
__device__ ​ __half hsin ( const __half a )
Calculates half sine in round-to-nearest-even mode.
__device__ ​ __half hsqrt ( const __half a )
Calculates half square root in round-to-nearest-even mode.
__device__ ​ __half htrunc ( const __half h )
Truncate input argument to the integral part.

Functions

__device__ ​ __half hceil ( const __half h )
Calculate ceiling of the input argument.
Returns

Returns ceiling expressed as a half-precision floating point number.

Description

Compute the smallest integer value not less than h.

__device__ ​ __half hcos ( const __half a )
Calculates half cosine in round-to-nearest-even mode.
Returns

Returns half cosine of a.

Description

Calculates half cosine of input a in round-to-nearest-even mode.

__device__ ​ __half hexp ( const __half a )
Calculates half natural exponential function in round-to-nearest mode.
Returns

Returns half natural exponential function of a.

Description

Calculates half natural exponential function of input a in round-to-nearest-even mode.

__device__ ​ __half hexp10 ( const __half a )
Calculates half decimal exponential function in round-to-nearest mode.
Returns

Returns half decimal exponential function of a.

Description

Calculates half decimal exponential function of input a in round-to-nearest-even mode.

__device__ ​ __half hexp2 ( const __half a )
Calculates half binary exponential function in round-to-nearest mode.
Returns

Returns half binary exponential function of a.

Description

Calculates half binary exponential function of input a in round-to-nearest-even mode.

__device__ ​ __half hfloor ( const __half h )
Calculate the largest integer less than or equal to h.
Returns

Returns floor expressed as half-precision floating point number.

Description

Calculate the largest integer value which is less than or equal to h.

__device__ ​ __half hlog ( const __half a )
Calculates half natural logarithm in round-to-nearest-even mode.
Returns

Returns half natural logarithm of a.

Description

Calculates half natural logarithm of input a in round-to-nearest-even mode.

__device__ ​ __half hlog10 ( const __half a )
Calculates half decimal logarithm in round-to-nearest-even mode.
Returns

Returns half decimal logarithm of a.

Description

Calculates half decimal logarithm of input a in round-to-nearest-even mode.

__device__ ​ __half hlog2 ( const __half a )
Calculates half binary logarithm in round-to-nearest-even mode.
Returns

Returns half binary logarithm of a.

Description

Calculates half binary logarithm of input a in round-to-nearest-even mode.

__device__ ​ __half hrcp ( const __half a )
Calculates half reciprocal in round-to-nearest-even mode.
Returns

Returns half reciprocal of a.

Description

Calculates half reciprocal of input a in round-to-nearest-even mode.

__device__ ​ __half hrint ( const __half h )
Round input to nearest integer value in half-precision floating point number.
Returns

Returns rounded integer value expressed as half-precision floating point number.

Description

Round h to the nearest integer value in half-precision floating point format, with halfway cases rounded to the nearest even integer value.

__device__ ​ __half hrsqrt ( const __half a )
Calculates half reciprocal square root in round-to-nearest-even mode.
Returns

Returns half reciprocal square root of a.

Description

Calculates half reciprocal square root of input a in round-to-nearest mode.

__device__ ​ __half hsin ( const __half a )
Calculates half sine in round-to-nearest-even mode.
Returns

Returns half sine of a.

Description

Calculates half sine of input a in round-to-nearest-even mode.

__device__ ​ __half hsqrt ( const __half a )
Calculates half square root in round-to-nearest-even mode.
Returns

Returns half square root of a.

Description

Calculates half square root of input a in round-to-nearest-even mode.

__device__ ​ __half htrunc ( const __half h )
Truncate input argument to the integral part.
Returns

Returns truncated integer value.

Description

Round h to the nearest integer value that does not exceed h in magnitude.