Skip to content

Commit

Permalink
SCC: Add logging of vector-within-seq markers, which indicate issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mlange05 authored and reuterbal committed Aug 30, 2023
1 parent 9a16efa commit 351a727
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions transformations/transformations/single_column_coalesced.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ def kernel_annotate_sequential_loops_openacc(cls, routine, horizontal):
# Perform pragma addition in place to avoid nested loop replacements
loop._update(pragma=(ir.Pragma(keyword='acc', content='loop seq'),))

# Warn if we detect vector insisde sequential loop nesting
nested_loops = FindNodes(ir.Loop).visit(loop.body)
loop_pragmas = flatten(as_tuple(l.pragma) for l in as_tuple(nested_loops))
if any('loop vector' in pragma.content for pragma in loop_pragmas):
info(f'[Loki-SCC::Annotate] Detected vector loop in sequential loop in {routine.name}')

@classmethod
def kernel_annotate_subroutine_present_openacc(cls, routine):
"""
Expand All @@ -389,12 +395,12 @@ def kernel_annotate_subroutine_present_openacc(cls, routine):
@classmethod
def insert_annotations(cls, routine, horizontal, vertical, hoist_column_arrays):

# Mark all non-parallel loops as `!$acc loop seq`
cls.kernel_annotate_sequential_loops_openacc(routine, horizontal)

# Mark all parallel vector loops as `!$acc loop vector`
cls.kernel_annotate_vector_loops_openacc(routine, horizontal, vertical)

# Mark all non-parallel loops as `!$acc loop seq`
cls.kernel_annotate_sequential_loops_openacc(routine, horizontal)

# Wrap the routine body in `!$acc data present` markers
# to ensure device-resident data is used for array and struct arguments.
cls.kernel_annotate_subroutine_present_openacc(routine)
Expand Down

0 comments on commit 351a727

Please sign in to comment.