HIP: Heterogenous-computing Interface for Portability
Loading...
Searching...
No Matches
Bfloat162 Conversion Functions

Functions

__HOST_DEVICE__ float2 __bfloat1622float2 (const __hip_bfloat162 a)
 Converts and moves bfloat162 to float2.
 
__HOST_DEVICE__ __hip_bfloat162 __bfloat162bfloat162 (const __hip_bfloat16 a)
 Moves bfloat16 value to bfloat162.
 
__HOST_DEVICE__ short int __bfloat16_as_short (const __hip_bfloat16 h)
 Reinterprets bits in a __hip_bfloat16 as a signed short integer.
 
__HOST_DEVICE__ unsigned short int __bfloat16_as_ushort (const __hip_bfloat16 h)
 Reinterprets bits in a __hip_bfloat16 as an unsigned signed short integer.
 
__HOST_DEVICE__ __hip_bfloat16 __double2bfloat16 (const double a)
 Convert double to __hip_bfloat16.
 
__HOST_DEVICE__ __hip_bfloat162 __float22bfloat162_rn (const float2 a)
 Convert float2 to __hip_bfloat162.
 
__HOST_DEVICE__ __hip_bfloat162 __halves2bfloat162 (const __hip_bfloat16 a, const __hip_bfloat16 b)
 Combine two __hip_bfloat16 to __hip_bfloat162.
 
__HOST_DEVICE__ __hip_bfloat16 __high2bfloat16 (const __hip_bfloat162 a)
 Returns high 16 bits of __hip_bfloat162.
 
__HOST_DEVICE__ __hip_bfloat162 __high2bfloat162 (const __hip_bfloat162 a)
 Returns high 16 bits of __hip_bfloat162.
 
__HOST_DEVICE__ float __high2float (const __hip_bfloat162 a)
 Converts high 16 bits of __hip_bfloat162 to float and returns the result.
 
__HOST_DEVICE__ __hip_bfloat162 __highs2bfloat162 (const __hip_bfloat162 a, const __hip_bfloat162 b)
 Extracts high 16 bits from each and combines them.
 
__HOST_DEVICE__ __hip_bfloat16 __low2bfloat16 (const __hip_bfloat162 a)
 Returns low 16 bits of __hip_bfloat162.
 
__HOST_DEVICE__ __hip_bfloat162 __low2bfloat162 (const __hip_bfloat162 a)
 Returns low 16 bits of __hip_bfloat162.
 
__HOST_DEVICE__ float __low2float (const __hip_bfloat162 a)
 Converts low 16 bits of __hip_bfloat162 to float and returns the result.
 
__HOST_DEVICE__ __hip_bfloat162 __lowhigh2highlow (const __hip_bfloat162 a)
 Swaps both halves.
 
__HOST_DEVICE__ __hip_bfloat162 __lows2bfloat162 (const __hip_bfloat162 a, const __hip_bfloat162 b)
 Extracts low 16 bits from each and combines them.
 
__HOST_DEVICE__ __hip_bfloat16 __short_as_bfloat16 (const short int a)
 Reinterprets short int into a bfloat16.
 
__HOST_DEVICE__ __hip_bfloat16 __ushort_as_bfloat16 (const unsigned short int a)
 Reinterprets unsigned short int into a bfloat16.
 

Detailed Description

To use these functions, include the header file hip_bf16.h in your program.