PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Order of keywords (restrict) for loop dependencies

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



Joined: 21 Jan 2010
Posts: 85

PostPosted: Thu Aug 26, 2010 6:57 am    Post subject: Order of keywords (restrict) for loop dependencies Reply with quote

Hello,
I programmed a small SAXPY example
Code:
#pragma acc region
  {
    for (i=0; i  < n ; ++i) {
       y[i]= a*x[i] + y[i];
  }
  }

setting the variables restricted (i.e.
Code:
restrict float* x, *y;
) and everthing worked with compiler versions 10.5 and 10.6: My accekerator kernel was always generated.

However, with Compiler version 10.8 (and also with 10.4 I've figured out) this is not working anymore:
Complex loop carried dependence of 'x' prevents parallelization
Loop carried dependence of 'y' prevents parallelization
Loop carried backward dependence of 'y' prevents vectorization
I have to reorder the restrict keyword to right hand-side:
Code:
float* restrict x;
float* restrict y;


But I do not understand why. Could anyone explain me this occurence?[/code]
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Aug 26, 2010 4:02 pm    Post subject: Reply with quote

Hi xray,

A recent fix in the compiler corrected some incorrect interpretations of the restrict keyword. Per the C99 standard, the restrict keyword must come after the "*" since it's applied to what's on it's left.

- 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