1.2.1. Half Arithmetic Constants

[Half Precision Intrinsics]

To use these constants, include the header file cuda_fp16.h in your program.

Defines

#define CUDART_INF_FP16
Defines floating-point positive infinity value for the half data type.
#define CUDART_MAX_NORMAL_FP16
Defines a maximum representable value for the half data type.
#define CUDART_MIN_DENORM_FP16
Defines a minimum representable (denormalized) value for the half data type.
#define CUDART_NAN_FP16
Defines canonical NaN value for the half data type.
#define CUDART_NEG_ZERO_FP16
Defines a negative zero value for the half data type.
#define CUDART_ONE_FP16
Defines a value of 1.0 for the half data type.
#define CUDART_ZERO_FP16
Defines a positive zero value for the half data type.

Defines

#define CUDART_INF_FP16

Value

__ushort_as_half((unsigned short)0x7C00U)

#define CUDART_MAX_NORMAL_FP16

Value

__ushort_as_half((unsigned short)0x7BFFU)

#define CUDART_MIN_DENORM_FP16

Value

__ushort_as_half((unsigned short)0x0001U)

#define CUDART_NAN_FP16

Value

__ushort_as_half((unsigned short)0x7FFFU)

#define CUDART_NEG_ZERO_FP16

Value

__ushort_as_half((unsigned short)0x8000U)

#define CUDART_ONE_FP16

Value

__ushort_as_half((unsigned short)0x3C00U)

#define CUDART_ZERO_FP16

Value

__ushort_as_half((unsigned short)0x0000U)