I reported this error when I started OpenAcc under PVF14.10, but it works fine when OpenAcc is not enabled. There is no problem in compiling. May I ask what went wrong? I installed cuda11.2 and PGI Visual fortran14.10 under windows.I opened OpenACC in Property-Language
program main
use openacc
implicit none
real,allocatable::v1(:)
integer length,idx
call acc_set_device_num(2,acc_device_nvidia)
length=102410241024
allocate(v1(length))
v1(1:length)=0.0
!$acc data copy(v1(1:length))
call add1(v1,length)
!$acc update host(v1(1:5))
print*,‘v1(1)=’,v1(1:5)
do idx=1,length
v1(idx)=v1(idx)+10
enddo
print*,‘v1(1)=’,v1(1:5)
!$acc update host(v1(1:5))
print*,‘v1(1)=’,v1(1:5)
!$acc end data
deallocate(v1)
end program
subroutine add1(vec,length)
use openacc
implicit none
integer,intent(in)::length
real,intent(inout)::vec(1:length)
integer idx
!$acc parallel loop present(vec(1:length))
do idx=1,length
vec(idx)=vec(idx)+idx
enddo
end subroutine