Have to use independent?

Hi

I’m new to this group and to GPU-programming.

In Fortran I have a problem about loop-parallelization.

Loop has the form

DO 10 I = 1,N
  K = INDXARRAY(I)
  ...
  DATAARRAY(K) = ...
  ...
10 CONTINUE

Compiler complains:
Complex loop carried dependence of ‘DATAARRAY’ prevents parallelization

But I know, that DATAARRAY(K) is different in each step. So this loop should be parallelizable.

I can enforce parallelization with “!$acc loop independent”.

I would prefere a solution where I would not prohibit the compiler-analyses for the whole loop but only for the lines I really analyzed. (In reality this loop is quite long and complex…)

Something like this would be nice:

DO 10 I = 1,N
  K = INDXARRAY(I)
  ...
!$acc THIS LINE DOENS NOT PREVENT PARALLELIZATION!
  DATAARRAY(K) = ...
  ...
10 CONTINUE

Any advice?

Benedikt

Hi Benedikt,

In the near term, there’s nothing like what you want. Though, I’ve added an Request for enhancement (TPR#20982) and sent it off to our representative on the OpenACC standards. Hopefully it’s something he can bring to the committee for consideration.

Thanks,
Mat