PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

The Arithmetic difference in fortran cuda

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
shyboy_6104



Joined: 17 Oct 2011
Posts: 5

PostPosted: Mon Mar 26, 2012 7:30 pm    Post subject: The Arithmetic difference in fortran cuda Reply with quote

I run a cuda fortran program in Nvidia M2050. I use the clause
Code:
ve(m,0) = ( vn(m,0)*3.0_8 - vn(m,-1) ) / 2.0_8
and the clause
Code:
ve(m,0) = ( vn(m,0)+vn(m,0)+vn(m,0) - vn(m,-1) ) / 2.0_8
, In most case , the results are same. But in some case , as an example, the former result is 3.2936043089008556E-002 while the latter result is 3.2936043089008549E-002. The array Vn, Ve is kind of real(8), which Digits of Precision is 15~16. If I only output 15 digits, the former result is 3.29360430890086E-002, and the latter result is 3.29360430890085E-002. [/b]
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6142
Location: The Portland Group Inc.

PostPosted: Tue Mar 27, 2012 8:09 am    Post subject: Reply with quote

Hi shyboy_6104,

The first version might be using a Fuse-Multiply-Add instruction (FMA) which will be different then the three adds. Try adding the flag "-Mcuda=nofma".

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group