|
| View previous topic :: View next topic |
| Author |
Message |
dcwarren
Joined: 18 Jun 2012 Posts: 29
|
Posted: Fri Feb 01, 2013 7:58 am Post subject: |
|
|
| 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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Fri Feb 01, 2013 10:13 am Post subject: |
|
|
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 |
|
 |
|
|
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 © 2001, 2002 phpBB Group
|