PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Problem with accelerator model data transfer

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



Joined: 10 Apr 2010
Posts: 5

PostPosted: Wed Jun 30, 2010 5:35 pm    Post subject: Problem with accelerator model data transfer Reply with quote

Hi, I am having a question concerning the data management of the pg fortran accelerator model. I have two subroutines. In the first subroutine I copy an array a to the device (using data region copyin(a)). Later on I use another subroutine that needs this array a on the device, what I now want is to use the array already on the device and not copy the array to the device a second time within the second subroutine. I hope someone has an idea how to deal with this problem, I think it is not possible to have a data region that starts in one subroutine and ends in another, right?
Thank you for your help.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5943
Location: The Portland Group Inc.

PostPosted: Thu Jul 01, 2010 2:01 pm    Post subject: Reply with quote

Hi Thomi,

While not implemented yet, the "reflected" and "mirror" clauses (See section 2.6.5 and 2.6.6 in http://www.pgroup.com/lit/whitepapers/pgi_accel_prog_model_1.2.pdf) will allow to have data regions that span across multiple subroutine calls.

In the meantime, you can use CUDA Fortran device allocatable arrays. As of release 10.4, the PGI Accelerator model allows the use of CUDA device data. Hence, you can allocate and copy your device data in one section of code, pass these device arrays as arguments, and use them within your ACC REGION.

The caveats are that mixing the two models is only supported on Linux and should be considered 'beta'. Also, using CUDA Fortran will break portability. But again, this could be a place holder until "reflected" and "mirror" are ready.

Hope this helps,
Mat
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