I have a pretty simple code fragment:
$acc data copy(a(:),b(:))
$acc kernels
$acc loop vector
do i=1,1000
x = a(i)
b(i) = sqrt(x)
enddo
$acc end kernels
$acc end data
And of course, I could dispense with x
easily, but this is an example and x
is the point of my question, which is: Does every thread here get its own copy of x
automatically, or should I declare it private to keep the various threads from clobbering it?