hipCUB
|
Host-based fp16 data type compatible and convertible with __nv_bfloat16 or hip_bfloat16. More...
#include <bfloat16.hpp>
Public Member Functions | |
__host__ __device__ __forceinline__ | bfloat16_t (int a) |
Constructor from integer. | |
bfloat16_t ()=default | |
Default constructor. | |
__host__ __device__ __forceinline__ | bfloat16_t (float a) |
Constructor from float. | |
__host__ __device__ __forceinline__ | operator float () const |
Cast to float. | |
__host__ __device__ __forceinline__ uint16_t | raw () const |
Get raw storage. | |
__host__ __device__ __forceinline__ bool | operator!= (const bfloat16_t &other) const |
Inequality. | |
__host__ __device__ __forceinline__ bfloat16_t & | operator+= (const bfloat16_t &rhs) |
Assignment by sum. | |
__host__ __device__ __forceinline__ bfloat16_t | operator* (const bfloat16_t &other) |
Multiply. | |
__host__ __device__ __forceinline__ bfloat16_t | operator+ (const bfloat16_t &other) |
Add. | |
__host__ __device__ __forceinline__ bfloat16_t | operator- (const bfloat16_t &other) |
Subtract. | |
__host__ __device__ __forceinline__ bool | operator< (const bfloat16_t &other) const |
Less-than. | |
__host__ __device__ __forceinline__ bool | operator<= (const bfloat16_t &other) const |
Less-than-equal. | |
__host__ __device__ __forceinline__ bool | operator> (const bfloat16_t &other) const |
Greater-than. | |
__host__ __device__ __forceinline__ bool | operator>= (const bfloat16_t &other) const |
Greater-than-equal. | |
Static Public Member Functions | |
__host__ __device__ static __forceinline__ bfloat16_t | max () |
numeric_traits<bfloat16_t>::max | |
__host__ __device__ static __forceinline__ bfloat16_t | lowest () |
numeric_traits<bfloat16_t>::lowest | |
Public Attributes | |
uint16_t | __x |
Friends | |
__host__ __device__ __forceinline__ friend bool | operator== (const bfloat16_t &a, const bfloat16_t &b) |
Equality. | |
Host-based fp16 data type compatible and convertible with __nv_bfloat16 or hip_bfloat16.