Fortran derived type on device

Dear NVIDIA experts,
If I want to use derived data type on GPU by using cuda frotran, for example, which one in the following is right (do the members in the type need device attribute)?

type:: mydata
integer,allocatable::data_a(:,:)
end type mydata

type(mydata),allocatable,device:: realdata(:)
type:: mydata
integer,allocatable,device::data_a(:,:)
end type mydata

type(mydata),allocatable,device:: realdata(:)

Thank you very much in advance!

1 Like