The problem here is that you’re trying to pass a device array to a subroutine that’s expecting a host array, hence the compiler can’t find a procedure that matches. You want to either change TOTOX to use the CUDA Fortran “device” attribute, or add a new subroutine to handle the device array. For example:
PROGRAM MAIN
INTERFACE TOTO
PROCEDURE TOTOX
#ifdef _OPENACC
PROCEDURE TOTOX_DEV
#endif
END INTERFACE
INTEGER, PARAMETER :: N = 10
REAL :: X (N)
!$ACC host_data use_device (X)
CALL TOTO (X, N)
!$ACC end host_data
CONTAINS
SUBROUTINE TOTOX (X, N)
REAL :: X (N)
INTEGER,value :: N
END SUBROUTINE
#ifdef _OPENACC
SUBROUTINE TOTOX_DEV (X, N)
use cudafor
REAL,device :: X (N)
INTEGER,value :: N
END SUBROUTINE
#endif
END
Be sure to add the “-cuda” option to enable CUDA Fortran.