using c++ vector class?

Dear PGI experts,

I am pretty new to OpenACC. Currently I would like to transfer my original c++ code to OpenACC one.

The problem is that OpenACC won’t compile vector class.

For example,

vector test;
test.resize(10);

#pragma acc parallel loop
for(int i = 0; i<10; i++)
{
test = i;
}

then compile it~~

PGCC-S-0155-Compiler failed to translate accelerator region (see -Minfo messages): unmanaged data structure (main.cpp: 44)

above message shows up.

Does anyone can help me to solve this problem?

Thanks in advance,

DK

Hi DK,

I’ve been experimenting with this. Basically, we need to add OpenACC directives (mostly “enter/exit data”, and “routine”) directly into the STL vector.h file. I also needed to add some extra routines to handle the data synchronization between the host and device.

I’ve got a prototype written up but it’s not well tested. Also, I haven’t thought about anything beyond basic data types and simple operators. Eventually, I get some more time to work on it and them hopefully we can start shipping it with the compilers.

  • Mat

Dear Mat,

Thank you for clarifying my curiosity :D

I will try to write my own vector class at this time.

DK