seibert
November 15, 2010, 2:02pm
21
I have a followup question here again after a little while =) . It turned out I got similar problems with addition in some case and I changed to __fadd_rn and that solved the problem. I noticed that there are similar functions for division, multiplication and addition but not for subtraction, why is that the case? Is subtraction basically an addition on instruction level? ( slightly modified ) Or how does it work? How would I do if I would like to use a “safe” subtraction in cuda?
One option is to stick a minus sign in front of the second argument in __fadd_rn(). Pure negation does not require any rounding, so that should be safe.
seibert
November 15, 2010, 2:02pm
22
I have a followup question here again after a little while =) . It turned out I got similar problems with addition in some case and I changed to __fadd_rn and that solved the problem. I noticed that there are similar functions for division, multiplication and addition but not for subtraction, why is that the case? Is subtraction basically an addition on instruction level? ( slightly modified ) Or how does it work? How would I do if I would like to use a “safe” subtraction in cuda?
One option is to stick a minus sign in front of the second argument in __fadd_rn(). Pure negation does not require any rounding, so that should be safe.
Mange
November 15, 2010, 2:52pm
23
Ah smart =) Thanks a lot!
Mange
November 15, 2010, 2:52pm
24
Ah smart =) Thanks a lot!