简体   繁体   English

__fp16 类型在 GNU ARM C++ 中未定义

[英]__fp16 type undefined in GNU ARM C++

I'm trying to use type __fp16 (half precision float) in program compiled with GNU ARM C++ Compiler however whenever I try to declare variable of this type I get an error message __fp16 is not declared .我试图在用 GNU ARM C++ 编译器编译的程序中使用类型__fp16 (半精度浮点数),但是每当我尝试声明这种类型的变量时,我都会收到一条错误消息__fp16 is not declared I assume that it's caused by the fact that I lack some header file, but I was unable to find any data on which header it might be.我认为这是由于我缺少一些头文件造成的,但是我无法找到有关它可能是哪个头文件的任何数据。 Does anybody know where it's defined / what shall I include?有谁知道它在哪里定义/我应该包括什么?

Yes the target supports half precision operations;是的,目标支持半精度操作; it doesn't support doubles.它不支持双打。

I got a reply from the GNU team.我收到了 GNU 团队的回复。 The solution is to add the compiler command -mfp16-format=ieee .解决方法是添加编译器命令-mfp16-format=ieee That defines __fp16 to ieee standard (see https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html )__fp16定义为 ieee 标准(参见https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM