I am using pgfortran on PGI suite 19.10.
I have very-simple nested loop, which just calculates the total-num of iterations.
implicit none integer i,j,N,ans N = 1000 ans = 0
!$acc data copy(ans) copyin(N) create(i,j)
!$acc parallel loop private(i,j) reduction(+:ans)
!$acc end parallel loop
!$acc end data
write(*,*) 'ans= ',ans
end program main
Now, each time, i run the program, i get a different answer!!!
Same problem if i replace the create(i,j) with copy(i,j).
BUT, if I
- remove create(i,j) on data-construct, OR
- remove private(i,j) on compute-construct, OR
- remove both of the above,
I get correct answer…
Not sure, why the complete specification (which i guess is correct, and as intended) is giving wrong answer??
Also the compiler messages (-Minfo=all) is SAME in both cases.