Skip to content

Commit

Permalink
loop fusion: use 'insert-loc' instead of 'insert'
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSt98 committed Oct 7, 2024
1 parent 99e335a commit 6797713
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion loki/transformations/tests/test_transform_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def test_transform_loop_fuse_ordering(frontend, insert_loc):
c(j) = j
enddo
!$loki loop-fusion group(1) {'insert' if insert_loc else ''}
!$loki loop-fusion group(1) {'insert-loc' if insert_loc else ''}
do i=1,n-1
do j=1,m
b(j, i) = n-i+1 + j
Expand Down
6 changes: 3 additions & 3 deletions loki/transformations/transform_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ def loop_fusion(routine):
return

# Merge loops in each group and put them in the position of the group's first loop
# UNLESS 'insert' location is specified for at least one of the group's fusion
# pragmas, in this case the position is the first occurence of 'insert' for each group
# UNLESS 'insert-loc' location is specified for at least one of the group's fusion
# pragmas, in this case the position is the first occurence of 'insert-loc' for each group
for group, loop_parameter_lists in fusion_groups.items():
loop_list, parameters = zip(*loop_parameter_lists)

# First, determine the collapse depth and extract user-annotated loop ranges from pragmas
collapse = [param.get('collapse', None) for param in parameters]
insert_locs = [param.get('insert', False) for param in parameters]
insert_locs = [param.get('insert-loc', False) for param in parameters]
if collapse != [collapse[0]] * len(collapse):
raise RuntimeError(f'Conflicting collapse values in group "{group}"')
collapse = int(collapse[0]) if collapse[0] is not None else 1
Expand Down

0 comments on commit 6797713

Please sign in to comment.