Order of keywords (restrict) for loop dependencies

I programmed a small SAXPY example

#pragma acc region
    for (i=0; i  < n ; ++i) {
       y[i]= a*x[i] + y[i];

setting the variables restricted (i.e.

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:

float* restrict x;
float* restrict y;

But I do not understand why. Could anyone explain me this occurence?[/code]

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