Refactoring a big code to remove fortran automatic array ( to avoid very costly reallocation on GPU )
… I’m trying to use a pool of generic global data , and the use only + => to rename the variable in a significant faction .
That work for CPU compilation, but not for GPU where the update clause doesn’t manage correctly the renaming .
All compiler concerned :
Compile for CPU :
pgf90 test_mirror_use_only.f90 -c
Compile for GPU
pgf90 -ta=nvidia test_mirror_use_only.f90 -c PGF90-S-0038-Symbol, aa, has not been explicitly declared (test_mirror_use_only.f90: 10) 0 inform, 0 warnings, 1 severes, 0 fatal for use_aa_rename
MODULE MODD_DATA IMPLICIT NONE REAL , ALLOCATABLE, DIMENSION(:) :: AA !$acc mirror(AA) END MODULE MODD_DATA SUBROUTINE USE_AA_RENAME() USE MODD_DATA, ONLY : MYDATA => AA IMPLICIT NONE !$acc update host(MYDATA) print*,"MYDATA=",MYDATA END SUBROUTINE USE_AA_RENAME
REM : with “USE MODD_DATA, ONLY : AA , MYDATA => AA” the sample compile again but it could by a problem if multiple variable with the same name come from different modules ( we have this case on our code … )