ecmwf-ifs / loki

Freely programmable source-to-source translation for Fortran
https://sites.ecmwf.int/docs/loki/
Apache License 2.0
29 stars 12 forks source link

acc seq bug #317

Closed ecossevin closed 3 months ago

ecossevin commented 4 months ago

I'm trying to add acc seq to a routine spec, and the "seq" disappears :

test.py :

from loki import *
src_file = "sub.F90"
src_name = "TEST"
source = Sourcefile.from_file(src_file)
routine = source[src_name]

routine.spec.insert(0,ir.Pragma(keyword='acc', content='routine ('+    routine.name+') seq'))
routine.spec.insert(1,ir.Comment(text=''))

print(fgen(routine))

sub.F90 :

SUBROUTINE TEST()

IMPLICIT NONE

END SUBROUTINE TEST

result :

[Loki::Sourcefile] Constructed from sub.F90 in 0.02s
SUBROUTINE TEST ()

!$acc routine( TEST )

  IMPLICIT NONE

END SUBROUTINE TEST
reuterbal commented 3 months ago

Confirmed and fixed in #324. There was a problem in the get_pragma_parameters utility that would ignore clauses without parentheses that occur after a clause with parentheses.