Skip to content

Commit

Permalink
#2717: Use is_parallelisable method in loop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Oct 23, 2024
1 parent c74d3e9 commit ce64ce9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/psyclone/tests/psyir/nodes/loop_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
# I. Kavcic, Met Office
# J. Henrichs, Bureau of Meteorology
# Modified by L. Turner, Met Office
# Modified J. G. Wallwork, University of Cambridge
# -----------------------------------------------------------------------------

''' Performs py.test tests on the Loop PSyIR node. '''
Expand Down Expand Up @@ -590,3 +591,6 @@ def test_loop_type(fortran_reader):
Loop.set_loop_type_inference_rules(None)
assert outer_loop.loop_type is None
assert inner_loop.loop_type is None

assert outer_loop.is_parallelisable
assert inner_loop.is_parallelisable
6 changes: 3 additions & 3 deletions src/psyclone/tests/psyir/tools/dependency_tools_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,8 @@ def test_array_access_pairs_multi_var(lhs, rhs, independent, fortran_reader):
])
def test_improved_dependency_analysis(lhs, rhs, is_parallelisable,
fortran_reader):
'''Tests the array checks of can_loop_be_parallelised.
'''Tests the array checks of can_loop_be_parallelised as called via the
is_parallelisable method of the Loop node.
'''
source = f'''program test
integer j, k, d_k
Expand All @@ -458,8 +459,7 @@ def test_improved_dependency_analysis(lhs, rhs, is_parallelisable,
end program test'''
psyir = fortran_reader.psyir_from_source(source)
loop = psyir.children[0].children[0]
dep_tools = DependencyTools()
result = dep_tools.can_loop_be_parallelised(loop)
result = loop.is_parallelisable
assert result is is_parallelisable


Expand Down

0 comments on commit ce64ce9

Please sign in to comment.