Internal compiler error in Debug mode only

Hello.

I want to debug my code but it doesn’t compile due to internal compiler error.

It compiles fine in Release mode.

Following is the code section where internal compiler error occurs.

ATTRIBUTES(DEVICE) SUBROUTINE cuXsTempInterpolation(itempmap, mytemp, ntemp, temp, wt1, wt2, it1, it2)
IMPLICIT NONE

INTEGER :: itempmap(:)
INTEGER :: ntemp
INTEGER :: it1, it2
REAL(GPU_PRECISION) :: mytemp
REAL :: temp(:)
REAL :: wt1, wt2

it1 = itempmap(floor(mytemp))
it2 = it1; wt2 = 1
IF (ntemp .NE. 1 .and. it1 .LT. ntemp) THEN
  it2 = it1 + 1
  wt2 = (mytemp - temp(it1)) / (temp(it2) - temp(it1))
ENDIF
wt1 = 1._8 - wt2

END SUBROUTINE

GPU_PRECISION is a predefined macro which is 4 in my code.

The internal compiler errors are:

오류 1 Internal compiler error. Invalid MDRef kind 7 C:\Users\USER\Dropbox\nTRACER\src\CUDAXS.cuf 619
오류 2 Internal compiler error. metadata elem should not be an int 3 C:\Users\USER\Dropbox\nTRACER\src\CUDAXS.cuf 619

Any ideas?

Hi CNJ,

I see one similar error in our bug tracker that was fixed in PGI 15.10 (TPR#21970).

If you have 15.10 or later, can you please send a reproducing example to PGI Customer Service (trs@pgroup.com)? Otherwise, please update the compiler and see it fixes the problem.

Thanks,
Mat

I’m using PVF 15.10, so compiler version won’t be a problem.

And I found the cause.

Sorry that I posted wrong code section.

The problem is occuring here.

ATTRIBUTES(GLOBAL) SUBROUTINE cuSetMacXs(Core, cuIsotope, cuFxr, cuXsData, xst, lscat1, lnelrhel)
USE PARAM
USE TYPEDEF,		ONLY : CoreInfo_Type,		Cell_Type
USE CUDATypeDef,	ONLY : cuIsotope_Type,		cuFxr_Type,			cuXsData_Type
USE CUDAMOCKernel,	ONLY : ng   !--- This is the problem
USE CUDAFOR
IMPLICIT NONE

!--- Read By Texture Cache
TYPE(CoreInfo_Type), INTENT(IN) :: Core
TYPE(cuIsotope_Type), INTENT(IN) :: cuIsotope
TYPE(cuFxr_Type), INTENT(IN) :: cuFxr
TYPE(cuXsData_Type), INTENT(IN) :: cuXsData
!-------------------------
REAL(GPU_PRECISION), DEVICE :: xst(:, :)
LOGICAL, VALUE :: lscat1, lnelrhel

TYPE(Cell_Type), POINTER :: Cell
INTEGER :: FsrIdxSt, nFsrInFxr, nFxr
INTEGER :: i, j, g, t, ig, ifsr, ifxr, ifxrlocal, icel
INTEGER :: ioutbeg, ioutend, ind1, ind2, it1, it2
INTEGER :: ntemp
REAL :: pnum, wt1, wt2, sigs1, sigs2
REAL :: xsmaca, xsmacs, xsmactr, xsmacstr
LOGICAL :: lresogrp

REAL, SHARED :: temp(cuXsData%ldiso%ntemp)
REAL, SHARED :: siga(cuXsData%ldiso%ntemp), sigs(cuXsData%ldiso%ntemp), sigsm(ng, cuXsData%ldiso%ntemp)
INTEGER, SHARED :: ioutsb(cuXsData%ldiso%ntemp), ioutse(cuXsData%ldiso%ntemp)
INTEGER, SHARED :: ib(ng, cuXsData%ldiso%ntemp), ie(ng, cuXsData%ldiso%ntemp)

END SUBROUTINE

This kernel is contained in a module named ‘CUDAXSKernel’

And CUDAMOCKernel is another module that also contains some kernels.

It also has some constant data.

The problem is coming from using other module’s constant data.

If I comment out

USE CUDAMOCKernel, ONLY : ng

the internal compiler error does not appear anymore.

Will this help?