慎用 maxrregcount

需要编译一个 *.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.”

 

转载于:https://www.cnblogs.com/xingzifei/p/7482454.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值