PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

CUDA Fortran x64 compile error

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
cyfengMIT



Joined: 07 Mar 2012
Posts: 22

PostPosted: Fri Apr 20, 2012 9:05 pm    Post subject: CUDA Fortran x64 compile error Reply with quote

Hi, all:

The following code was compiled and excuting successfully while using the Win32 configuration. However, an error occurred while using the x64 configuration. The error message is "error F0000 : Internal compiler error. pgnvd job exited with nonzero status code 0". The OS is Win 7 and the PVF version is 10.9. Did I do something wrong ?
Code:

MODULE TEST
use cudafor
use cudadevice
contains
      ATTRIBUTES (GLOBAL) SUBROUTINE SUB(N, D_MA )
     IMPLICIT NONE
     INTEGER, VALUE :: N
     !INTEGER, DEVICE :: N  !<--- HOST MUST HAVE A VARIABLE DECLARED THAT WAY TOO!!
     REAL*8,DEVICE:: D_MA(N,N)
    
     CALL D_DSWAP(N, D_MA(:,5),1, D_MA(:,N-10),1)
    
     END SUBROUTINE SUB
!
     ATTRIBUTES (DEVICE) SUBROUTINE D_DSWAP(N,DX,INCX,DY,INCY)
      IMPLICIT NONE
      INTEGER,VALUE::N
      INTEGER,VALUE:: INCX,INCY
      REAL*8,DEVICE:: DX(*),DY(*)
!     .. Local Scalars ..
      REAL*8,DEVICE:: DTEMP
      INTEGER,DEVICE:: I,IX,IY,M,MP1
!     ..
!     .. Intrinsic Functions ..
      INTRINSIC MOD

      IF (INCX.EQ.1 .AND. INCY.EQ.1) THEN

!       code for both increments equal to 1
!       clean-up loop
!
         M = MOD(N,3)
         IF (M.NE.0) THEN
            DO I = 1,M
               DTEMP = DX(I)
               DX(I) = DY(I)
               DY(I) = DTEMP
            END DO
            IF (N.LT.3) RETURN
         END IF
         MP1 = M + 1
         DO I = MP1,N,3
            DTEMP = DX(I)
            DX(I) = DY(I)
            DY(I) = DTEMP
            DTEMP = DX(I+1)
            DX(I+1) = DY(I+1)
            DY(I+1) = DTEMP
            DTEMP = DX(I+2)
            DX(I+2) = DY(I+2)
            DY(I+2) = DTEMP
         END DO
      ELSE
!
!       code for unequal increments or equal increments not equal
!         to 1
!
         IX = 1
         IY = 1
         IF (INCX.LT.0) IX = (-N+1)*INCX + 1
         IF (INCY.LT.0) IY = (-N+1)*INCY + 1
         DO I = 1,N
            DTEMP = DX(IX)
            DX(IX) = DY(IY)
            DY(IY) = DTEMP
            IX = IX + INCX
            IY = IY + INCY
         END DO
      END IF

      END SUBROUTINE D_DSWAP
END MODULE TEST
!----------------------------------------------------------------------------
      SUBROUTINE DSWAP(N,DX,INCX,DY,INCY)
      INTEGER INCX,INCY,N
      DOUBLE PRECISION DX(*),DY(*)
!     .. Local Scalars ..
      DOUBLE PRECISION DTEMP
      INTEGER I,IX,IY,M,MP1
!     ..
!     .. Intrinsic Functions ..
      INTRINSIC MOD
!     ..
      IF (N.LE.0) RETURN
      IF (INCX.EQ.1 .AND. INCY.EQ.1) THEN

!       code for both increments equal to 1
!       clean-up loop
!
         M = MOD(N,3)
         IF (M.NE.0) THEN
            DO I = 1,M
               DTEMP = DX(I)
               DX(I) = DY(I)
               DY(I) = DTEMP
            END DO
            IF (N.LT.3) RETURN
         END IF
         MP1 = M + 1
         DO I = MP1,N,3
            DTEMP = DX(I)
            DX(I) = DY(I)
            DY(I) = DTEMP
            DTEMP = DX(I+1)
            DX(I+1) = DY(I+1)
            DY(I+1) = DTEMP
            DTEMP = DX(I+2)
            DX(I+2) = DY(I+2)
            DY(I+2) = DTEMP
         END DO
      ELSE
!
!       code for unequal increments or equal increments not equal
!         to 1
!
         IX = 1
         IY = 1
         IF (INCX.LT.0) IX = (-N+1)*INCX + 1
         IF (INCY.LT.0) IY = (-N+1)*INCY + 1
         DO I = 1,N
            DTEMP = DX(IX)
            DX(IX) = DY(IY)
            DY(IY) = DTEMP
            IX = IX + INCX
            IY = IY + INCY
         END DO
      END IF
      RETURN
      END SUBROUTINE DSWAP
!
!  ConsoleApp.f90
!
!  Fortran Console Application
!  Generated by PGI Visual Fortran(R)
!  4/20/2012 9:03:43 PM
!

      program prog
      use test
      implicit none
      integer::i,r,N
      INTEGER,DEVICE::D_N
      real*8, ALLOCATABLE :: MA(:,:), MB(:,:)
      real*8, DEVICE, allocatable :: D_MA(:,:)
     
      N=9200
      D_N=N
      ALLOCATE(MA(N,N), MB(N,N))
      do i=1, N
      MA(:,i)=dble(i)
      end do

      print*, "MA(:,5)= ", MA(1,5)
      print*, "MA(:,N-10)= ", MA(1,N-10)

      ALLOCATE(D_MA(N,N))
      D_MA=MA
      CALL SUB<<<1>>>(N, D_MA)
      MB=D_MA
     
      print*, "MB(:,5)= ", MB(1,5)
      print*, "MB(:,N-10)= ", MB(1,N-10)           
      DEALLOCATE(D_MA)

      call DSWAP(N,MA(:,5),1,MA(:,N-10),1)
      print*, "MA(:,5)= ", MA(1,5)
      print*, "MA(:,N-10)= ", MA(1,N-10)
     
      DEALLOCATE(MA,MB)
      end program prog
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6134
Location: The Portland Group Inc.

PostPosted: Tue Apr 24, 2012 11:54 am    Post subject: Reply with quote

Hi CyfengMIT,

Do you have access to a new version of the compiler? 10.9 is fairly old and you program compiles fine in the latest version (12.4).

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group