0

I have an array of float (fp32) and want to convert it to an array of fp16 and Bfloat16 and vice versa (converting 16 bit floats to fp32) . Are there any vectorized instructions that allow me to do that ?

Also if i had like to compute some math operations directly on 16 bit floats, do hardware support those , for example computing dot product (sum, difference) between two arrays of fp16 or bFloat16

user179156
  • 841
  • 9
  • 31
  • 2
    https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#othertechs=FP16C&avx512techs=AVX512_FP16 FP16C gives you the ability to convert between fp16 and fp32 - this is available on most AVX CPUs. AVX512-fp16 provides the ability to perform maths on fp16 directly, but is only supported by a very small number of the latest CPUs. Otherwise you'll need t convert from fp16 to fp32, do the maths, and convert back again. – robthebloke Sep 12 '22 at 23:43

0 Answers0