How to get to the second line when the clause after !$acc is too long?
when I use & at the end of the first line ,the compiler tell me the second line is Illegal continuation line.
This is my code:
!$acc kernels loop &
copyin (x(offs(i)+1:offs(i)+nsec),y(offs(i)+1:offs(i)+nsec))
my compiler is PGI visual fortran
thank you very much
HuWei39533:
How to get to the second line when the clause after !$acc is too long?
when I use & at the end of the first line ,the compiler tell me the second line is Illegal continuation line.
This is my code:
!$acc kernels loop &
copyin (x(offs(i)+1:offs(i)+nsec),y(offs(i)+1:offs(i)+nsec))
my compiler is PGI visual fortran
thank you very much
I think there are a couple ways:
!$acc kernels loop &
!$acc copyin (x(offs(i)+1:offs(i)+nsec),y(offs(i)+1:offs(i)+nsec))
or you can do this:
!$acc kernels loop &
!$acc& copyin (x(offs(i)+1:offs(i)+nsec),y(offs(i)+1:offs(i)+nsec))
The standard seems to accept either.
TheMatt:
HuWei39533:
How to get to the second line when the clause after !$acc is too long?
when I use & at the end of the first line ,the compiler tell me the second line is Illegal continuation line.
This is my code:
!$acc kernels loop &
copyin (x(offs(i)+1:offs(i)+nsec),y(offs(i)+1:offs(i)+nsec))
my compiler is PGI visual fortran
thank you very much
I think there are a couple ways:
!$acc kernels loop &
!$acc copyin (x(offs(i)+1:offs(i)+nsec),y(offs(i)+1:offs(i)+nsec))
or you can do this:
!$acc kernels loop &
!$acc& copyin (x(offs(i)+1:offs(i)+nsec),y(offs(i)+1:offs(i)+nsec))
The standard seems to accept either.
Thanks very much! No errors now
garcfd
August 24, 2023, 5:18pm
4
I found that only this works:
!$acc parallel loop collapse(3)
!$acc& private(Q,E1,E2,F1,F2,G1,G2)
!$acc& reduction(max:maxvel,maxwig)