PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

user defined type allocatable array not supported?

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



Joined: 19 Oct 2009
Posts: 8

PostPosted: Wed Mar 30, 2011 10:18 pm    Post subject: user defined type allocatable array not supported? Reply with quote

I got an error message for the line highlighted in the following code, saying two device variables in the same assignment.
Is there a way I can resolve this? thanks

Code:

module mCuda
integer :: num_cm
type tCM
 integer, allocatable, device :: fine(:)
 real, allocatable, device :: mat_matrix(:,:,:)
 real, allocatable, device :: src_matrix(:,:,:)
end type

type(tCM), allocatable, device :: cm_list(:)
module

program test
use mCuda

integer i

num_cm=10
allocate (cm_list(num_cm))
do i=1, num_cm
allocate(cm_list%fine(3))
cm_list%fine=10              !this line causes the error message

enddo


end

Back to top
View user's profile
mkcolg



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

PostPosted: Fri Apr 01, 2011 3:27 pm    Post subject: Reply with quote

Hi tty103,

You have a couple of typos in the code but after fixing these, I assuming that this is the error that you are seeing:
Quote:

PGF90-S-0519-More than one device-resident object in assignment (test.cuf: 24)
0 inform, 0 warnings, 1 severes, 0 fatal for test


Currently the size of the UDT must be known at allocation so unfortunately, you'll need to change UDT device allocatables to fixed sized arrays. We are in the process of adding this support for similar features and I have opened a feature request (TPR#17771) with your particular example.

Thanks,
Mat
% cat test.cuf
module mCuda
integer :: num_cm
type tCM
integer :: fine(3)
end type

type(tCM), allocatable, device :: cm_list(:)

end module

program test
use mCuda

integer i,j

num_cm=10
allocate (cm_list(num_cm))
do i=1, num_cm
cm_list(i)%fine=10
enddo


end


Code:
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