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
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
You have a couple of typos in the code but after fixing these, I assuming that this is the error that you are seeing:
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