PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

variables from HOST code to DEVICE code

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



Joined: 21 Feb 2012
Posts: 15

PostPosted: Mon Apr 23, 2012 8:58 am    Post subject: variables from HOST code to DEVICE code Reply with quote

Dear all,

maybe the question is stupid but I read the documentation twice and I am not sure about this point.

Let's assume that I open a ACC region and I parallelize a DO loop. Within this DO loop I access an array by using two indexes: X and Y. Y, the inner index just after the "!$acc do", is distributed across parallel workers byt the runtime. X, index of an outer loop outside the ACC region, may vary between 1 and 3 (sometimes 5).

Do I have to specify in the ACC data region clause "copyin(X)"?
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Apr 24, 2012 12:01 pm    Post subject: Reply with quote

Hi fspiga,

Quote:
Do I have to specify in the ACC data region clause "copyin(X)"?
Nope. The compiler will create a private variable for each thread and initialize it to the value of X, or pass in X as an argument to the kernel.

- 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