hello, I have a code like:
1 Module XXX
2 use :: cusparse
3 use :: cublas
4 use :: cudafor
5 implicit none
6 type, extends(FX) :: FX
7 private
8 real(wp), device, allocatable :: F(:)
9 contains
…
10 end type FX
11 contains
12 subroutine FFX(this, A,B,L,n,nc,nb…)
13 use :: cublas
14 use :: cudafor
15 class(FX),intent(inout) :: this
16 real(wp),device, intent(in) :: A(:),B(:),L(:)
17 integer,device :: n,nc,nb
18 real(wp),device :: q(3)
19 allocate( this%F(n) )
20 this%F =0._wp
21
22 !$cuf kernel do <<< , >>>
23 do i=1, nc
24 do ii=1,nb
25 q=A((i-1) *nc + ii:(i-1) *nc + ii+3)
26 this%F((i-1) *nc + ii:(i-1) *nc + ii+3)=this%F((i-1) *nc + ii:(i-1) *nc + ii+3)+q
27 end do
28 end do
29 end subroutine …
30 end module …
Although the F is defined as device parameter, now I get the error for the line 22 and 26 as below.
And I don’t know why Kernel region is being ignored?
NVFORTRAN-W-0155-Data clause needed for exposed use of pointer this%F$p
NVFORTRAN-S-0155-Kernel region ignored; see -Minfo messages (22)
NVFORTRAN-S-0155-Host array used in CUF kernel - F$f(:) (26)
NVFORTRAN-S-0155-Host array used in CUF kernel - F$f202(:)
NVFORTRAN-S-0155-Host array used in CUF kernel - F$f203(:)
NVFORTRAN-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Unable to find associated device pointer
NVFORTRAN/x86-64 Linux 20.7-0: compilation aborted
I would appreciate any help.