开发者

fermi cuda double precision against C

there is a small error between CPU and GPU double precision results, using a fermi GPU.

e.g. for a small test set, I get the following absolute error for: (Number 1(CPU) - Number 2(GPU)) = 3E-018.

开发者_开发知识库

in binary form it is as expected very small…

NUMBER 1 in binary:

xxxxxxxxxxxxx11100000001001

vs

NUMBER 2 in binary:

xxxxxxxxxxxx111100000001010

Although this is a difference of one binary digit, I am keen to eliminate any differences, as the errors addup during my code.

any tips from those familiar with fermi? if this is unavoidable can I get C/C++ to mimic the fermi rounding off behaviour?


You should take a look at this post.

Floating point is not associative, so if a compiler chooses to do operations in a different order then you'll get a different result. Two versions of the same compiler can produce differences! Different compilers are even more likely to produce differences, and if you're doing work in parallel on the GPU (you are, right?) then you're inherently doing operations in a different order...

Fermi hardware is IEEE754-2008 compliant, which means that in addition to IEEE754 standard rounding it also has the fused multiply-add (FMA) instruction which avoids losing precision between multiplication and addition.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜