大佬教程收集整理的这篇文章主要介绍了在XCode中将denormal flush设置为零(FTZ),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
#include <fenv.h> fesetenv(FE_DFL_DISABLE_SSE_DENORMS_ENV);
应该做你想做的事.
FE_DFL_DISABLE_SSE_DENORMS_ENV A pointer to a fenv_t object with the default floaTing-point state modifed to set the DAZ and FZ bits in the SSE status/control register. When using this environment,denormals encountered by SSE based calculation (which normally should be all single and double precision scalar floating point calculations,and all SSE/SSE2/SSE3 computation) will be treated as zero. Calculation results that are denormals will also be truncated to zero.
设置此选项可将程序的运行时间从Why does changing 0.1f to 0 slow down performance by 10x?减少(@mysticial在其评论中给出的链接)从27秒减少到0.3秒(MACBook Pro,2.5 GHz Intel Core 2 Duo).
以上是大佬教程为你收集整理的在XCode中将denormal flush设置为零(FTZ)全部内容,希望文章能够帮你解决在XCode中将denormal flush设置为零(FTZ)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。