Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line continuation character not always recognized #30

Closed
johnmauff opened this issue Nov 24, 2021 · 2 comments · May be fixed by #29
Closed

Line continuation character not always recognized #30

johnmauff opened this issue Nov 24, 2021 · 2 comments · May be fixed by #29

Comments

@johnmauff
Copy link

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

@domcharrier
Copy link
Collaborator

domcharrier commented Nov 25, 2021

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

@domcharrier domcharrier linked a pull request Nov 25, 2021 that will close this issue
@johnmauff
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants