PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Bug in accelerator implementation of Fortran abs() intrinsic

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



Joined: 28 Jul 2004
Posts: 3

PostPosted: Thu Dec 02, 2010 4:47 pm    Post subject: Bug in accelerator implementation of Fortran abs() intrinsic Reply with quote

Hi,

PGI Fortran 10.9-0 implementation of the Fortran abs() intrinsic contains a rather embarassing bug for complex arguments. Namely, it is implemented internally as:

complex(8) :: value
real(8) :: result

result = hypot(value,value)

... which in fact is equivalent to:

result = sqrt(2d0) * abs(real(value,kind=8))

Obviously, this is not the intended result. The correct implementation would be:

result = hypot(real(value,kind=8),aimag(value))

This kind of implementation error should have been picked up by the most rudimentary test set.

Since complex math is rather important for my applications, could anybody enlighten me exactly what does and does not get tested for Fortran instrinsic implementation in Fortran CUDA code generator/run-time library?

Serguei
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