请教一个关于cudafortran结构体并行的问题
subroutine IntegrateMomentum()
!------------------------------------------------------------------
!- Purpose -
!- 1. Integrating the momentum equations on the -
!= computational grid -
!- 2. Apply boundary conditions -
!------------------------------------------------------------------
use ParticleData
use GridData
implicit none
integer:: c, n ! loop counter
type(GridNodeProperty), POINTER :: gd
type(GridNode), POINTER :: node
do c = 1, nb_component
do n = 1, nb_gridnode
gd => grid_list(c, n)
node => node_list(n)
! Integrate momentum equation
if(istep == 1) then
gd%PXg = gd%PXg + gd%FXg * DT*0.5
else
gd%PXg = gd%PXg + gd%FXg * DT
end if
这是我想并行的代码,grid_list是一个结构体数组变量,其中结构体中元素PXg为大小为3的一维数组。
我这样声明real(8),device,allocatable::grid_list(:,:)%PXg(3),grid_list(:,:)%FXg(3)设备变量不太对,编译通不过,另外想知道kernel函数该怎么写,因为没有结构体的例子,新手不知道该怎么下手。谢谢啦