How to enable __fp16 type on gcc for x86_64

依然范特西╮ 提交于 2019-12-03 02:12:07

I did not find a way to do so in gcc (as of gcc 8.2.0).

As for clang, in 6.0.0 the following options showed some success:

clang -cc1 -fnative-half-type -fallow-half-arguments-and-returns

The option -fnative-half-type enable the use of __fp16 type (instead of promoting them to float). While the option -fallow-half-arguments-and-returns allows to pass __fp16 by value, the API being non-standard be careful not to mix different compilers.

That being said, it does not provide math functions using __fp16 types (it will promote them to/from float or double).

It was sufficient for my use case.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!