Hi,
I get an error when trying to compile a progrma with an enclosing openmp directives within which
I have an OpenACC kernel that calls a routine.
program test
IMPLICIT NONE
INTEGER :: k, t
REAL :: x
x = 0
!$omp parallel do private(t)
DO t = 1, 20
!$acc kernels loop private(x,k)
DO k = 1, 2
!x = x + 1
CALL hello(x)
ENDDO
!$acc end kernels
ENDDO
!$omp end parallel do
PRINT*, x
CONTAINS
SUBROUTINE hello(x)
!$acc routine seq
REAL, INTENT(INOUT) :: x
x = x + 1
END SUBROUTINE
end program test
The error i get when compiling
$ pgf95 -O3 -mp -acc -Minfo=accel -ta=tesla:cc60,cuda10.1 ompacc.f90 -o kernel_v2
test:
12, Loop is parallelizable
Generating Tesla code
12, !$acc loop gang, vector(32) ! blockidx%x threadidx%x
hello:
24, Generating acc routine seq
Generating Tesla code
nvvmCompileProgram error: 9.
Error: /tmp/pgaccrOdgZRIJzdyN.gpu (63, 14): parse invalid forward reference to function '_hello_' with wrong type!
PGF90-S-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (ompacc.f90: 27)
0 inform, 0 warnings, 1 severes, 0 fatal for
Either removing the openmp directives or removing the routine call compiles the code.