Potential compiler bug

Inside a function, I have:

VECTOR<int,3> array_index_3;
#pragma acc parallel loop reduction(+:psi_sum) copyin(psi[0:1],psi->value.base_pointer[psi_base_ptr_offset:psi_base_ptr_offset+psi_size])
for(int k=1;k<=psi_size;k++){

where psi is a pointer to a class containing a 3D array class called value, which keeps a pointer to its dynamically-allocated data in base_pointer. This all works fine as is and the psi_sum is identical to running the above code without openacc.

However, if I then declare an ARRAY test(n) elsewhere in this function, I get the compilation error:
1267, Accelerator restriction: call to ‘PhysBAM::VECTOR<int, (int)3>::~VECTOR()’ with no acc routine information

What explanation could there be as to why declaring an ARRAY, totally unrelated to the ACC region, affects whether the compiler can instrument the VECTOR’s destructor with acc routine information?

update: In a simpler example, when I try to just copy over any contents from the T* within the ARRAY class, the compiler crashes with no pertinent info:

#pragma acc parallel loop reduction(+:psi_sum) copyin(test_array[0:1],test_array.base_pointer[1:2])

scons: *** [build/nocona/release/Projects/mt_kinetic_theory/main-gpu.os] Error 127
pgc+±Fatal-/opt/pgi/linux86-64/16.10/bin/pggpp2 TERMINATED by signal 11
Arguments to /opt/pgi/linux86-64/16.10/bin/pggpp2

I think there’s something about our ARRAY class that’s breaking the compiler. It relies heavily on template metaprogramming for type checking. Is there any way to diagnose this crash?

Hi scook005,

Can you please send a reproducing example of the code that causes the compiler crash to PGI Customer Service (trs@pgroup.com)? We’ll want to get this our compiler engineers to determine the problem and get it fixed (if not already fixed).

As for the first problem, the message seems to imply that an object of this type is being created (and destroyed) in device code. Exactly why this is occurring, I can’t tell from the information given. Perhaps an object is being passed by value or there’s a local object of the class declared in the device code? If you can send a reproducing example to PGI Customer service and ask them to send it to me, I’ll take a look and see what I can determine.