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

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?

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

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

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.