首页 > 其他 > 详细

慎用 maxrregcount

时间:2017-09-06 00:08:51      阅读:944      评论:0      收藏:0      [点我收藏+]

需要编译一个 *.cubin 文件。

在编译时使用--ptxas-option=v参数,显示register使用的个数是36。于是,在编译时使用maxrregcount=32。从而,register的使用个数是32,使用了“8 bytes stack frame, 12 bytes spill stores, 28 bytes spill loads”

nvcc -cubin -m64 -arch sm_35 *.cu --use_fast_math --maxrregcount=32 --ptxas-options=-v -O3 -o *.cubin

但是,经过多次测试,发现浮点计算结果不一样(int计算结果没有测试)。

因此,发现了这个bug:maxrregcount可能导致最终结果不同。

 

搜了一下,其他人也遇到了这个问题。有一个解释如下:

“Operation order may change with register optimization. Since fp arithmetic is not associative due to finite precision, this may affect the result.”

 

慎用 maxrregcount

原文:http://www.cnblogs.com/xingzifei/p/7482454.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!