#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)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)