ROCm / gpufort

GPUFORT: S2S translation tool for CUDA Fortran and Fortran+X in the spirit of hipify

Home Page:https://rocmsoftwareplatform.github.io/gpufort/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Line continuation character not always recognized

johnmauff opened this issue · comments

When a Fortran line continuation character (&) is included in either an expression or an !$acc directive the parser fails to recognize the source code. See the example code snippet below

     ```

!$acc data copyin(a,b) copyout(c_gpu)
!$acc parallel loop collapse(2) &
!$acc reduction(+:tmp)
do j=1,colsB
do i=1,rowsA
tmp = 0.0
!$acc loop vector reduction(+:tmp)
do k=1,rowsB
tmp = tmp &
+ a(i,k) * b(k,j)
enddo
c_gpu(i,j) = tmp
enddo
enddo
!$acc end parallel
!$acc end data

Would you mind to recheck with the develop-acc branch?
It appears that this issue was fixed there.

Using that branch, the above multi-line directive is correctly converted into the
following single-line directive:

! ...
!$acc parallel loop collapse(2)   reduction(+:tmp) 
! ... 

Link to the corresponding test:
https://github.com/ROCmSoftwarePlatform/gpufort/blob/develop-acc/python/test/linemapper/test.linemapper.linemapper.py

Thanks for your suggestion. Use of the develop-acc branch did indeed resolve this issue.