Hello,
I am able to reproduce a compilation error in my C++ and OpenACC program.
#include <iostream>
class foo
{
public:
foo(int nbEqs, int nOrder);
~foo();
void createDeviceData();
void calculation();
private:
int _nbEqs;
int _elem;
};
foo::foo(int nbEqs, int nOrder)
{
_nbEqs = nbEqs;
_elem = nOrder;
}
foo::~foo()
{
}
void foo::createDeviceData()
{
#pragma acc enter data copyin(this)
}
void foo::calculation()
{
#pragma acc parallel loop \
copyin(_elem)
for (int i=0; i<_nbEqs; i++)
{
double temp[_elem];
for (int i=0; i<_elem; i++)
{
temp[i] = 1.;
}
}
}
int main()
{
foo obj(100,3);
obj.createDeviceData();
obj.calculation();
std::cout << "Done" << std::endl;
}
With “pgc++ -acc -ta=nvidia,lineinfo -Minfo=accel test3.C”, the compilation error reads:
"test3.C", line 36: warning: variable "temp" was set but never used
double temp[_elem];
^
foo::createDeviceData():
28, Generating enter data copyin(this[:1])
PGCC-S-0155-Accelerator region ignored; see -Minfo messages (test3.C: 31)
foo::calculation():
31, Accelerator region ignored
34, Accelerator restriction: loop contains unsupported statement type
40, Accelerator restriction: unsupported statement type: opcode=DEALLOC
PGCC/x86-64 Linux 19.4-0: compilation completed with severe errors
Could you advise why the error would arise?
Thanks,
Shine