Hi,
i have added some openacc directives (kernels,etc) in my serial code,and i met some problems that confused me, perhaps it’s a simple question ,but i don’t why it occured.
call to cuLaunchKernel returned error 1: Invalid value
and i tested my serial F90 code in intel visual fotran 2013 compiler,it worked fine.but in PGI community edition 18.4,i received warning like this(but it can still work):
PGF90-W-0103-Type conversion of subscript expression for ind_p (try.f90: 1032)
please, can someone tell me why it occured and how to solve it.
thank you!
Hi Guo,
Would it be possible for you to post a snippet of the problematic section?
Thank you for your reply!
I found the error, i made a silly mistake that i add the kernel derictives in a wrong place which prevented parallelization. Now it works.
But i still couldn’t find out why the warning "PGF90-W-0103-Type conversion of subscript expression for ind_p (try.f90: 1032)"occurs, the serial code were tested successfully in visual studio 2013 compiler.
real(8) function Dx_WENO(i,j,var_u,var_C)
integer ind_p(0:4,0:1),iip,...........
.........
do p=0,1
do k=0,4
iip=ind_p(k,p)
var_p(k,p)=0.5*var_C(iip,j)
iin=ind_n(k,p)
var_n(k,p)=0.5*var_C(iin,j)
end do
...........
end do
the variable ind_p only took part in some simple operations, i had no idea where the warning came from.
thank you !
Hi Guo shuhao,
How is “p” declared? If you’re using implicit typing, variables starting with “p” would be typed as real. Using a real as as index into an array would cause this warning.
For example:
% cat test.f90
real(8) function Dx_WENO(var)
real(8) :: var(0:1,0:4)
s=0.0
do p=0,1
do k=0,4
s = s+ var(p,k)
end do
end do
Dx_WENO = s
end function Dx_WENO
% pgfortran test.f90 -c
PGF90-W-0103-Type conversion of subscript expression for var (test.f90: 8)
0 inform, 1 warnings, 0 severes, 0 fatal for dx_weno
Explicitly typing “p” as an integer will remove the warning:
% cat test.f90
real(8) function Dx_WENO(var)
real(8) :: var(0:1,0:4)
integer :: p,k
s=0.0
do p=0,1
do k=0,4
s = s+ var(p,k)
end do
end do
Dx_WENO = s
end function Dx_WENO
% pgfortran test.f90 -c
%
Hope this helps,
Mat
Thank you!
now the warning disappears. It’s really a silly question, haha .