PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

OpenACC compatibility with std::vector

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
lschneid



Joined: 22 Mar 2013
Posts: 7

PostPosted: Fri Mar 22, 2013 10:34 am    Post subject: OpenACC compatibility with std::vector Reply with quote

Hi,

at GPU Tech Conf I learnt that PGI has C++ support for OpenACC. A lot of our code uses std::vector. According to the standard std::vector guarantees contiguous memory and in principal it can be used like a C array by means of &v[0].
Can std::vectors be used in acc parallel loop sections and if so how do you address them in acc data clauses as v in the typical e.g. copy(v) would be of type std::vector and not double*.
Or would I have to workaround it locally with double* p = &v[0] if I were not willing to change all std::vectors to C arrays in my code?

Thanks,
Lutz
Back to top
View user's profile
Deborah Caruso



Joined: 20 Oct 2004
Posts: 43

PostPosted: Fri Mar 22, 2013 12:57 pm    Post subject: Reply with quote

Lutz-

We do not yet support vectors in OpenACC regions. The "[]" operator may work like
C, but vectors require constructors, destructors, and other functions masquerading
as operators. These functions can not yet be run in OpenAcc regions. You would
have to work around it locally with a C array.
Back to top
View user's profile
lschneid



Joined: 22 Mar 2013
Posts: 7

PostPosted: Fri Mar 22, 2013 4:37 pm    Post subject: Reply with quote

Hi Deborah,

thanks for the quick response. Your answer somehow implies that you might support this in the future. In case you have this on your list how would rate the priority (high - medium - low)?

Thanks,
Lutz
Back to top
View user's profile
Deborah Caruso



Joined: 20 Oct 2004
Posts: 43

PostPosted: Wed Mar 27, 2013 9:36 am    Post subject: Reply with quote

We are still investigating the technical issues involved in implementing this, and have not
yet added it to our schedule. It does not have high priority. User interest
plays a part in all of this. Please file a bug report/request for enhancement if this
issue is important to you.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group