In a fortran module, i have an array that has a SAVE attribute.
module test
REAL,DIMENSION(ITB),PRIVATE,SAVE :: STHE
!$acc declare create(STHE)
contains
subroutine init_sthe()
!initialize sthe on device doesn't work, but initialize on host and copy later owrks
end subroutine
subroutine use_sthe()
!!acc copyin(sthe)
!use sthe on device
end subroutine
end module
If I try to declare the array on device at module level and initilize it later directly on device in the init subroutine, it doesn’t seem to work. However, if i remove the declare subroutine on STHE, and simply do the initialization on the CPU, then copy the data to the device in use_sthe it works. Why the first approach doesn’t work ?
I read that PGI OpenACC did not support SAVE attribute a while ago, but seems to be supported now since PGI 15.5. Are module level SAVE attribute arrays actually supported now?
Thanks
Daniel