PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

Allocatable derived types

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



Joined: 15 Jan 2011
Posts: 3

PostPosted: Thu Mar 01, 2012 7:27 pm    Post subject: Allocatable derived types Reply with quote

Hi,

I've found a problem on allocatable derived types with device attribute.
The test code is attached.

Compiling the code with CUDA Fortran from PGI Workstation 11.10 and CUDA4.0
the output of the executable is:

cudaSetDevice: istat = 0
allocate: istat = 0
3.141592653589793
3.141592653589793
3.141592653589793
3.141592653589793

However, compiling the code with CUDA Fortran from PGI Workstation 12.2 and CUDA4.0,
the output of the executable is:

cudaSetDevice: istat = 0
allocate: istat = 0
3.141592653589793
3.141592653589793
********************
********************

It seems that the arrays are not correctly allocated using v12.2.

The situation is the same both in Windows(64-bit) and Linux(64-bit).

Tetsuo

Code:

program TEST
use cudafor
implicit none
integer, parameter :: KRSZ   = selected_real_kind(15)

type :: yield_
  real(KRSZ) :: x_fin(1:10) = acos(-1.0_KRSZ)
end type yield_

type(yield_), allocatable, device :: yield(:)

real(KRSZ) :: rtmp

integer :: istat

istat = cudaSetDevice(0)
write(*,*) 'cudaSetDevice: istat =', istat

allocate( yield(1:2), STAT=istat )
write(*,*) 'allocate: istat =', istat
rtmp = yield(1)%x_fin( 1) ; write(*,*) rtmp
rtmp = yield(1)%x_fin(10) ; write(*,*) rtmp
rtmp = yield(2)%x_fin( 1) ; write(*,*) rtmp
rtmp = yield(2)%x_fin(10) ; write(*,*) rtmp

end program TEST
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Mar 02, 2012 12:30 pm    Post subject: Reply with quote

Hi t-san,

Thank you for the report. This does appear to be a compiler error and we have begun to investigate. This is being tracked as TPR#18511.

Best Regards,
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