# using c++ vector class?

**URL:** <https://forums.developer.nvidia.com/t/using-c-vector-class/134206>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [August 11, 2014, 9:01am UTC](https://forums.developer.nvidia.com/t/using-c-vector-class/134206 "2014-08-11T09:01:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AwesomeDK](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AwesomeDK](https://forums.developer.nvidia.com/u/AwesomeDK)\
**Post date:** [August 11, 2014, 9:01am UTC](https://forums.developer.nvidia.com/t/using-c-vector-class/134206/1 "2014-08-11T09:01:45Z")

</div>

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_

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [August 11, 2014, 6:18pm UTC](https://forums.developer.nvidia.com/t/using-c-vector-class/134206/2 "2014-08-11T18:18:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AwesomeDK](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AwesomeDK](https://forums.developer.nvidia.com/u/AwesomeDK)\
**Post date:** [August 11, 2014, 11:58pm UTC](https://forums.developer.nvidia.com/t/using-c-vector-class/134206/3 "2014-08-11T23:58:58Z")

</div>

Dear Mat,

Thank you for clarifying my curiosity :D

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

DK
