PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Problems of fortran functions erfc(x) and conjg(complex).

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



Joined: 03 Dec 2009
Posts: 6

PostPosted: Mon Mar 29, 2010 3:55 am    Post subject: Problems of fortran functions erfc(x) and conjg(complex). Reply with quote

When I tried to accelerate our fortran program, I found some errors in certain fortran functions.

One is the complementary error function, erfc(x). It returned me with NaN result.
Another is conjg(x) function, it returns conjugate of complex x, but seems not included in pgfortran.

The conjugate function is easy to replace with other writing way, but erfc is rather difficult.

Is there any plan to fix those?
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Mar 29, 2010 4:39 pm    Post subject: Reply with quote

Hi tiomiya,

Support for the "CONJG" elemental function within an PGI Accelerator region was added to the 10.3 release.

As for "erfc", I'm not sure how you were able to add this to an Accelerator region. "erfc" is an external function not part of the Fortran language so you should have seen a message like
Quote:
19, Accelerator region ignored
22, Accelerator restriction: function/procedure calls are not supported
24, Accelerator restriction: unsupported call to 'erfc'

I went ahead and added a feature request (TPR#16766) to have "erfc" recognized, but am puzzled how you got a NaN.

Did you use the erfc function within an accelerator region? Can you post a small example or send the code to PGI Customer Service?

Thanks,
Mat
Back to top
View user's profile
tiomiya



Joined: 03 Dec 2009
Posts: 6

PostPosted: Tue Mar 30, 2010 2:10 am    Post subject: Err...I had changed my way to use erfc... Reply with quote

Sorry for I can't give the clear information about erfc(x).
The erfc was original error in a non-parallelized region.
But the program continuously sent valuables into the erfc function, and I didn't find out which of them actually caused the NaN fault.
I fixed our code to avoid using erfc because I also need to parallelize those codes, like changed erfc to...

!erfc function
t=1.0 / (1.0 + 0.3275911 * x )
xsqq=x * x
tp = t * (0.254829592 + t*(-0.284496736 + t * (1.421413741 + t * (-1.453152027 + t * 1.061405429))))
erfcc = tp * exp(-xsqq)

After this, the program goes well, and I didn't save error backup.

If I find something wrong about erfc afterwards, I'll post.

Thank you.
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