Hi,
I have a triple loop that finds the maximum value over a single dimension array.
The basic code is:
!$acc parallel loop collapse(3)
do k=1,nk
do j=1,nj
do i=1,ni
value1=<computation in all 3 dimensions>
value2=<computation in all 3 dimensions>
max1d(i)=max(max1d(i),value1,value2)
enddo
enddo
enddo
If I try to put an “acc atomic” before the max line, the compiler fails saying the atomic operation is not valid.
If I instead make a temporary scalar “maxv12=max(value1,value2)” and then have:
!$acc atomic
max1d(i)=max(max1d(i),maxv12)
than the compiler doesn’t complain and the code works fine.
Why can I not have more than two arguments in the “max” call for an atomic operation?
- Ron