Skip to content

Commit

Permalink
#2716 fix tests broken by merge
Browse files Browse the repository at this point in the history
  • Loading branch information
arporter committed Oct 8, 2024
1 parent b9987fc commit 0fd9464
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ def test_kernel_gpu_annotation_trans(rtrans, expected_directive,
rtrans.apply(kern)

# Check that the directive has been added to the kernel code
code = fortran_writer(kern.get_kernel_schedule())
_, kschedules = kern.get_kernel_schedule()
code = fortran_writer(kschedules[0])
assert expected_directive in code


Expand Down
14 changes: 7 additions & 7 deletions src/psyclone/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,15 @@ def apply(self, node, options=None):
node.modified = True

# Get the schedule representing the kernel subroutine
routine = node.get_kernel_schedule()
_, routines = node.get_kernel_schedule()
else:
routine = node

for child in routine.children:
if isinstance(child, OMPDeclareTargetDirective):
return # The routine is already marked with OMPDeclareTarget
routines = [node]

routine.children.insert(0, OMPDeclareTargetDirective())
for routine in routines:
for child in routine.children:
if isinstance(child, OMPDeclareTargetDirective):
break # routine is already marked with OMPDeclareTarget
routine.children.insert(0, OMPDeclareTargetDirective())

def validate(self, node, options=None):
''' Check that an OMPDeclareTargetDirective can be inserted.
Expand Down

0 comments on commit 0fd9464

Please sign in to comment.