PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

update vs copy

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



Joined: 26 Jun 2012
Posts: 44

PostPosted: Tue Oct 29, 2013 8:41 pm    Post subject: update vs copy Reply with quote

Hello,

Is there any reason to use one over the other (besides aesthetic purposes)? For example, is there a difference between

!$acc update host(list)
and
!$acc pcopyout(list)

Same idea for update device and pcopyin.



Also, a second unrelated question. Suppose I have the structure below:
!$acc data region copy(a,b,c)
!$acc kernels
loop that uses a, b, and c
!$acc end kernels
!$acc end data region

The compiler feedback tells me that a, b, and c are copied in the data region, and tells me again that a, b, and c are copied for the kernels region. This is just redundant, and a, b, and c are not actually being copied twice, correct? And is this still correct even in older compilers that don't by default use the present_or copy versions?

Thanks,
Ben
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Oct 30, 2013 7:35 am    Post subject: Reply with quote

Hi Ben,

The update directive is used to synchronize data within a data region while the copy clauses only synchronize data at the beginning or end of a data region.

Quote:
The compiler feedback tells me that a, b, and c are copied in the data region, and tells me again that a, b, and c are copied for the kernels region. This is just redundant, and a, b, and c are not actually being copied twice, correct?
These messages are confusing but the data isn't being copied twice. The compiler is adding a device look-up just before the kernel launches since the look-up is associated with an address rather than a variable name. This allow for such things as pointer swapping in a data region and data regions to span across routine calls.

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