Appearing inside more than one level of nested ACC loop directives prevents the compiler from automatically recognizing and making scalar variables PRESENT in the enclosing ACC parallel region. Bug or feature?
The code below fails because the scalar integer variables MROWS, KLOWER, KUPPOER, NDOF are not automatically considered PRESENT because they only appear inside doubly nested ACC LOOP directives:
!$acc parallel vector_length(32)
!$acc loop gang private(ib,ie)
do ib=1,1
!$acc loop vector private(ie)
do ie=es,ee
call myfunction ( mrows,klower,kupper,ndof )
enddo
enddo
!$acc end parallel
Adding a present clause fixes the problem:
!$acc parallel vector_length(32) present(mrows,klower,kupper,ndof)
!$acc loop gang private(ib,ie)
do ib=1,1
!$acc loop vector private(ie)
do ie=es,ee
call myfunction ( mrows,klower,kupper,ndof )
enddo
enddo
!$acc end parallel
Should that be necessary? Thank you,
John