I’ve been looking to use CUDA Fortran and/or OpenACC to accelerate some kernels in a moderately large code I work with (which is written in OO F03). However, I’ve been encountering several issues compiling with PGI.
I’ve created a small test program that demonstrates the current issues I’m observing, which seem to be related to allocatable arrays in user defined derived types. Any thoughts on what sorts of support should be coming out in future releases? Or work-arounds to these issues?
PROGRAM vector IMPLICIT NONE TYPE,ABSTRACT :: VectorType LOGICAL(4) :: isInit=.FALSE. INTEGER(4) :: n=0 ENDTYPE VectorType TYPE,EXTENDS(VectorType) :: RealVectorType REAL(8),ALLOCATABLE :: b(:) ENDTYPE RealVectorType TYPE(RealVectorType) :: thisVector INTEGER(4) :: n=5 SELECTTYPE(thisVector); TYPE IS(RealVectorType) IF(.NOT. thisVector%isInit) THEN IF(n < 1) THEN WRITE(*,*) 'fail' ELSE thisVector%isInit=.TRUE. thisVector%n=n ALLOCATE(thisVector%b(n)) WRITE(*,*) 'success' ENDIF ENDIF ENDSELECT ENDPROGRAM vector