I intend to use half-precision floating-point in my code but I am not able to figure out how to declare them. For Example, I want to do something like the following-
fp16 a_fp16;
bfloat a_bfloat;
However, the compiler does not seem to know these types (fp16
and bfloat
are just dummy types, for demonstration purposes)
I remember reading that bfloat
support was added into GCC-10, but I am not able to find it in the manual.I am especially interested in bfloat
floating numbers
Additional Questions -
- FP16 now has hardware support on Intel / AMD support as today? I think native hardware support was added since Ivy Bridge itself. (https://scicomp.stackexchange.com/questions/35187/is-half-precision-supported-by-modern-architecture)
- I wanted to confirm whether using FP16 will indeed increase FLOPs. I remember reading somewhere that all arithmetic operations on
fp16
are internally converted to fp32 first, and only affect cache footprint and bandwidth. - SIMD intrinsic support for half precision float, especially
bfloat
(I am aware of intrinsics like_mm256_mul_ph
, but not sure how to pass the 16bit FP datatype, would really appreciate if someone could highlight this too) - Are these types added to Intel Compilers as well ?
PS - Related Post - Half-precision floating-point arithmetic on Intel chips , but it does not cover on declaring half precision floating point numbers.
TIA