ecmwf-ifs / loki

Freely programmable source-to-source translation for Fortran

Home Page:https://sites.ecmwf.int/docs/loki/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue with acc loop gang

ecossevin opened this issue · comments

SUBROUTINE TOTO(A,B)

IMPLICIT NONE
REAL, INTENT(IN) :: A
REAL, INTENT(INOUT) :: B

!$ACC PARALLEL LOOP GANG &
!$ACC&PRESENT(ZRDG_LCVQ,ZFLU_QSATS,ZRDG_CVGQ) &
!$ACC&PRIVATE (JBLK) &
!$ACC&VECTOR_LENGTH (YDCPG_OPTS%KLON)

END SUBROUTINE TOTO

from loki import *
path="sub.F90"
file=Sourcefile.from_file(path)
routine=file["TOTO"]
print(fgen(routine))

loki removes the "&" after !$ACC PARALLEL LOOP GANG statement.

Hi @ecossevin I can confirm that this is indeed an issue (and wrong). The problem seem to be that the lack of whitespaces in the second pragma line !$ACC& ... seems to defeat the pragma parsers and doesn't register as part of the pragma (!$ACC & ... works). I'll investigate further and hopefully find a fix.