PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

private OpenACC clause on loop, kernels, and parallel constr
Goto page Previous  1, 2
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
dcwarren



Joined: 18 Jun 2012
Posts: 29

PostPosted: Fri Feb 01, 2013 7:58 am    Post subject: Reply with quote

mkcolg wrote:
Until then, the recommendation is not put scalars in private clauses unless absolutely necessary.


If I try this with my code, I get complaints about live-out induction variables. Making the induction variable private to the loop stops the compiler from moaning, but apparently incurs a performance penalty. How can I inform the compiler that the variable "i" in a loop really doesn't need to be remembered for the next loop over "i"?
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Feb 01, 2013 10:13 am    Post subject: Reply with quote

You need to look how the induction variables are being declared and used. The clear case is when they are used on the right hand side after the compute region. Less clear cases are if they are declared global, used as arguments to a sub-routine, or have some other static storage. Sometimes branches can also cause this.

The quick method is to set the variables to some value immediately after the loop where they are used or use different induction variables. (i.e. "i=1"). But otherwise, this is a cause where the "private" clause may be necessary.

- 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
Goto page Previous  1, 2
Page 2 of 2

 
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