PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

OpenACC private variables

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



Joined: 06 Jun 2012
Posts: 1

PostPosted: Sat Oct 20, 2012 5:25 am    Post subject: OpenACC private variables Reply with quote

Hello,
We have codes with fat loops, that need private variables.in OpenACC directives.
For some reasons, the compiler doesn't process or even reports an error.
Could you tell us the reason, and the way to go around the problem.
Thanks for your fast feedback.
Alain Clo
Research Computing - Kaust

Here is an example of what is needed and what the compiler reports.
#pragma acc loop collapse( 3 ) independent
#pragma acc & private( i, j, k, arg, x, y, z, xi, yi, zi, tempdX0, tempdY0, tempdZ0, &
#pragma acc & tempdXP1, tempdYP1, tempdZP1, tempdXC1, tempdYC1, tempdZC1, &
#pragma acc & NX, NY, NZ, xyzsqrt, dNT, NT, tempd, cons_over_xyzsqrt, &
#pragma acc & absiNX, absjNY, abskNZ, count )
for(i=0; i<=nx; i++) { // spatial loops
for(j=0; j<=ny; j++){
for(k=0; k<=nz; k++){

PGC-S-0035-Syntax error: Recovery attempted by replacing '&' by accparallel (skeleton-c-new-acc.c: 729)
PGC-S-0035-Syntax error: Recovery attempted by replacing acc by '(' (skeleton-c-new-acc.c: 730)
PGC-S-0037-Syntax error: Recovery attempted by deleting keyword private (skeleton-c-new-acc.c: 730)
PGC-S-0032-Syntax error: Unexpected input at <nl> (skeleton-c-new-acc.c: 730)
Back to top
View user's profile
mkcolg



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

PostPosted: Sun Oct 21, 2012 7:12 am    Post subject: Reply with quote

Hi Alain,

The problem here is that you're using Fortran continuation characters. In C, to continue a line you need to put an escape character at the end of the line and don't add a another "#pragma". Also, scalar variables are privatized by default, so you should avoid adding them to a private clause. Worse, by privatizing them, you've put the variable into global memory versus having the potential of it being put into a register.

- Mat
Code:

#pragma acc loop collapse( 3 ) independent  \
     private(....., \
             .....)
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