PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Reduction results in wrong results. Bug?
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
mkcolg



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

PostPosted: Tue Nov 27, 2012 8:37 am    Post subject: Reply with quote

Quote:
I'm curious if the private(i,j) clause is really necessary
Scalars are privatized by default, so no, privatizing i and j is not necessary. As you found out, privatizing them can actually slow down your code. Privatizing a scalar variable will create an array of the variables, one for each thread, in global memory. If it's not privatized, the variable is declared locally in the kernel and thus more likely to be stored in a register which is much faster to access.

- Mat
Back to top
View user's profile
PaulPa



Joined: 02 Aug 2012
Posts: 35

PostPosted: Tue Nov 27, 2012 10:17 am    Post subject: Reply with quote

Is that true for the PGI compiler or for OpenACC in general?
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Nov 27, 2012 5:21 pm    Post subject: Reply with quote

Quote:
Is that true for the PGI compiler or for OpenACC in general?
I'm not sure. I believe it's true for Cray, but don't know for CAPS. The OpenACC 2.0 spec does clear this up a bit by adding a "default(none)" clause which will require the user to explicitly which variables are private. The exception being the loop index variables which are always private.

- Mat
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 445

PostPosted: Fri Jan 24, 2014 3:26 pm    Post subject: TPR 19023 has added a new feature to 14.1 Reply with quote

hello,
We have added compiler feedback when a reduction is performed.

thanks,
dave
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