Sorry, passing local scalar variables by reference isn’t supported. I added an RFE (TPR#21358) to see if it’s something we can add.
Here’s the message I get after adding “volatile” to “j” declaration:
% pgcc -acc -V15.1 testj.c -Minfo=accel -ta=tesla:nollvm
PGC-W-0095-Type cast required for this conversion (testj.c: 30)
set:
7, Generating acc routine worker
Generating Tesla code
PGC-S-0155-Accelerator region ignored; see -Minfo messages (testj.c: 24)
main:
21, Generating copyout(a[:])
24, Accelerator region ignored
27, Accelerator restriction: invalid loop
29, Accelerator restriction: Unsupported variable reference type
PGC/x86-64 Linux 15.1-0: compilation completed with severe errors
I added “volatile” to prevent the compiler from hoisting j’s declaration outside of the loop. This is a normal optimization but like your previous post with the local array, shouldn’t be done in this case. I added TPR#21359 to address this issue.
thanks for your clarification. I think that this would be a very useful feature otherwise acc routine does not really cover a large set of functions used in general code.
As a workaround we tried to have a function return a struct but that also did not seem to be supported.
For the code we are looking to port to GPU we are coming to the conclusion that unfortunately we have to leave OpenACC aside for the time being and resort to Cuda.
Thanks,
Lutz
PS: As a PGI customer is there a way to track the status of a ticket or is this for internal use only?