PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

error with derived types in PGI CUDA 10.4
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
goblinsqueen



Joined: 04 Feb 2010
Posts: 14

PostPosted: Tue Apr 13, 2010 6:46 am    Post subject: error with derived types in PGI CUDA 10.4 Reply with quote

Today I installed PGI CUDA Fortran v. 10.4.
The following code (working with v. 10.3) cannot be compiled anymore with the new version.
Code:

module mod_test
 use cudafor
 implicit none
 type comp
   integer :: n
   real*8  :: r
 end type
 type(comp), device :: struct_dev
contains
 attributes(device) real*8 function calc2(i)
   implicit none
   integer, value :: i
   integer :: j
   calc2 = 0.d0
   do j=1,struct_dev%n
     calc2 = calc2 + log(real(i)) * struct_dev%r
   end do
 end function
 attributes(device) subroutine calc(counter,idx,Vettore)
   implicit none
   integer, value :: counter, idx
   real*8, dimension(counter),device :: Vettore
   !real*8, dimension(32), shared :: vettore_shared
   real*8 :: var
   integer :: i, tid
   tid = threadidx%x
   !var = 0.
   do i=1,20
      var = calc2(i) 
   enddo
   Vettore(idx) = Vettore(idx)+var
   !vettore_shared(tid) =vettore_shared(tid)+ var
 end subroutine
 attributes(global) subroutine kernel_test(counter,Vettore)
   implicit none
   integer, value :: counter
   real*8, dimension(counter),device :: Vettore
   integer :: idx
   idx = (blockidx%x-1)*blockdim%x + threadidx%x
   call calc(counter,idx,Vettore)
 end subroutine
end module
program test
 use cudafor
 use mod_test
 implicit none
 integer :: nblocks, nthreads, counter
 integer :: c1, c2
 real*8, dimension(:), allocatable :: Vettore_host
 real*8, dimension(:), allocatable, device :: Vettore_dev
 counter = 9216
 nthreads = 32
 nblocks = counter/nthreads
 call system_clock(count=c1)
 allocate(Vettore_host(counter),Vettore_dev(counter))
 Vettore_dev = 0.d0
 Vettore_host = 0.d0
 struct_dev%n = 10
 struct_dev%r = 0.1d0
 call kernel_test<<<nblocks,nthreads>>>(counter,Vettore_dev)
 Vettore_host = Vettore_dev
 deallocate(Vettore_host,Vettore_dev)
 call system_clock(count=c2)
 write(*,*) 'time ', c2-c1
end program
 


This is the error message I get:
Quote:

/tmp/pgcudaforp5ebTWCUwOMw.gpu(14): error: no suitable conversion function from "struct <unnamed>::<unnamed>" to "int *" exists

/tmp/pgcudaforp5ebTWCUwOMw.gpu(18): error: no suitable conversion function from "struct <unnamed>::<unnamed>" to "double *" exists

2 errors detected in the compilation of "/tmp/pgnvdd6ebjwUXYAt3.nv0".
PGF90-F-0000-Internal compiler error. pgnvd job exited with nonzero status code 0 (test.cuf: 41)
PGF90/x86-64 Linux 10.4-0: compilation aborted


It seems that the problem is in the use of the derived type variable struct_dev, but I cannot understand why.

Thank you for any hint!
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Apr 13, 2010 10:51 am    Post subject: Reply with quote

Hi Goblinsqueen,

Looks like a new compiler error. 10.4 has a lot of changes in it and we obviously missed this issue. I have sent a report to our engineers (TPR#16836) and hopefully we can have it fixed shortly.

The work around is to continue using 10.3 or replace "struct_dev" with it's components.

Code:
     integer,device :: devn
     real*8,device  :: devr


Thanks,
Mat
Back to top
View user's profile
goblinsqueen



Joined: 04 Feb 2010
Posts: 14

PostPosted: Wed Apr 14, 2010 2:07 am    Post subject: Reply with quote

Hi Mat,
I think that for the moment I'll keep using 10.3.
Do you think this problem will be fixed in 10.5?
Do you already know when 10.5 will be released?
Thanks!
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Apr 14, 2010 8:19 am    Post subject: Reply with quote

Hi goblinsqueen,

Quote:
Do you think this problem will be fixed in 10.5?
Depending upon when the issue is submitted and it's severity, we do try an resolve issues within a month. Though, there no guarantee. Feel free to ping me or PGI Customer Service for status.
Quote:
Do you already know when 10.5 will be released?
We try to release the first Thursday of each month with 10.5 currently schedule for May 6th. (Our versioning changed this year to mean Year.Month). Granted releases date can and do occasionally slip by a few days.

Hope this helps,
Mat
Back to top
View user's profile
goblinsqueen



Joined: 04 Feb 2010
Posts: 14

PostPosted: Thu Apr 15, 2010 12:23 am    Post subject: Reply with quote

Thank you!
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
Goto page 1, 2  Next
Page 1 of 2

 
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