关于NVIDIA GPU的IEEE-754标准(sm_13) [英] IEEE-754 standard on NVIDIA GPU (sm_13)

查看:235
本文介绍了关于NVIDIA GPU的IEEE-754标准(sm_13)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在主机和设备(GPU arch sm_13)上执行浮点(单精度)操作,那么值是不同的?

If I perform a float (single precision) operation on a Host and a Device (GPU arch sm_13) , then will the values be different ?

推荐答案

有关这方面的一个很好的讨论可以在白皮书。基本上:

A good discussion of this is availble in a whitepaper from NVIDIA. Basically:


  • IEEE-754几乎是目前所有的功能;

  • 这个标准,你仍然可以看到结果的差异(着名的,英特尔在内部为双精度做80位),或高优化设置与您的编译器可以改变结果

  • 计算能力2.0及更高版本NVIDIA卡支持单精度和双精度的IEEE-754,只有非常小的注意事项

    • 一些操作不支持某些舍入模式 - 这只有在明确

    • 有一些细微之处涉及融合乘法并添加

    • CUDA还提供,并且当然如果你明确或隐含地使用它们(有编译器选项),你自然不会得到完整的ieee-754结果

    • IEEE-754 is implemented by almost everything currently;
    • Even between faithful implementation of this standard, you can still see differences in results (famously, Intel's doing 80-bit internally for double precision), or high optimization settings with your compiler can change results
    • Compute capability 2.0 and later NVIDIA cards support IEEE-754 in both single and double precision, with only very small caveats
      • Some rounding modes aren't supported for some operations - this is only relevant if you explicitly change rounding modes in your code
      • There's some subtleties involving fused multiply and adds
      • CUDA also provides (slightly) lower precision but faster implementations of several operations, and of course if you use those explicitly or implicitly (with compiler options) you naturally won't get full ieee-754 results

      这篇关于关于NVIDIA GPU的IEEE-754标准(sm_13)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆