Hi again,
This is my code:
ATTRIBUTES(global) SUBROUTINE ForkCollapse3Dto2D (ipointerStart,&
ipointerEnd, &
ipointerBlock, &
numbasis, &
kp0, &
kpt, &
igall, igall_size, &
cx,&
cvs1, &
csm, csm_row, csm_col)
USE cudafor
IMPLICIT NONE
INTEGER, INTENT(IN) :: ipointerStart, ipointerBlock, ipointerEnd
INTEGER, INTENT(IN) :: numbasis, kp0, kpt, igall_size, csm_row, csm_col
INTEGER, INTENT(IN) :: igall(igall_size)
COMPLEX*16, INTENT(IN):: cx(numbasis)
COMPLEX*16, INTENT(IN):: cvs1(2, kp0, numbasis)
COMPLEX*16, INTENT(INOUT) :: csm(csm_row, csm_col)
!Working variables
INTEGER :: ns, ipindexStart, ipindexEnd, ipindexBlock, ipindex, ipointer, i, istat, ipointer
!GPGPU Kernel Declaration
TYPE(dim3) :: dimGrid, dimBlock
i = (blockidx%x-1) * blockdim%x + threadidx%x
ipointer = ipointerStart + i - 1
if(ipointer .gt. ipointerEnd) return
ns = (ipointer - 1) * kpt
ipindexStart = igall(ipointer)
ipindexEnd = igall(ipointer+1)-1
ipindexBlock = ipindexEnd - ipindexStart + 1
! do ipindex = ipindexStart, ipindexEnd
! csm(1:2, ns+1 : ns+kpt) = csm(1:2, ns+1 : ns+kpt) + cvs1(1:2,1:kpt,ipindex) * cx(ipindex)
! enddo
dimBlock = dim3(128,1,1)
dimGrid = dim3(ceiling(real(kpt/dimBlock%x)),1,1)
CALL collapse3Dto2D <<<dimGrid, dimBlock>>> (ns, kpt, ipindexStart, ipindexEnd, numbasis, cx, cvs1, csm)
END SUBROUTINE ForkCollapse3Dto2D
While compiling pgfortran, I get this error:
Error: /tmp/pgcudaforOYhb4kn9RGNL.gpu (289, 47): parse use of undefined value ‘%sym_ftn_sqrt_297_p0’
PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (cacxmp_gpu.f90: 1)
I don’t understand the compiler error but I know that the error comes from :
CALL collapse3Dto2D <<<dimGrid, dimBlock>>> (ns, kpt, ipindexStart, ipindexEnd, numbasis, cx, cvs1, csm)
The
collapse3Dto2D
is an empty kernel
ATTRIBUTES(device) SUBROUTINE collapse3Dto2D (ns, kpt, ipindexStart, ipindexEnd, numbasis, cx, cvs1, csm)
USE cudafor
END SUBROUTINE collapse3Dto2D
The empty subroutine is tasked to perform these 3 commented line:
! do ipindex = ipindexStart, ipindexEnd
! csm(1:2, ns+1 : ns+kpt) = csm(1:2, ns+1 : ns+kpt) + cvs1(1:2,1:kpt,ipindex) * cx(ipindex)
! enddo
How do I solve this problem?
Regards,
Phoon