Using complex power in C pgcc-

I’m trying to use the function cpow() in an accelerated C loop. and get the error:

Accelerator restriction: call to ‘cpow’ with no acc routine information
PGC/x86-64 Linux 18.10-0: compilation completed with severe errors

When I use

#include <accelmath.h>

I still get the error.

This sounded familiar, and in my testing, this was fixed sometime between 18.10 and 19.10. Do you have access to a more recent compiler?

  • Brent

Do you happen to have a link to the current functions in accelmath.h? I can’t find it anywhere and I want to make sure I’m using cpow right before I respond incorrectly.

I just did it this way and it compiles for me:

#include <complex.h>
int testcpow( double complex *a, double complex *b, double complex *c)
{
#pragma acc parallel loop
for(int i = 0; i < 100; i++) {
c[i] = cpow(a[i], b[i]);
}
return 0;
}

Thanks for the reply Brent though you haven’t really addressed my question. Which functions does accelmath.h work with and which does it not work with? Is there an API somewhere?

Anything listed in accelmath.h should work, though there is some redundancy with math.h, and it makes more sense to just include math.h if you are using a standard libm function. There are no complex functions in accelmath.h, which is why in your first post including accelmath.h did not make a difference.