Skip to content

Commit

Permalink
#2690 Renamed file to follow naming convention.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiker committed Oct 9, 2024
1 parent 6713beb commit 915988d
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion doc/user_guide/psy_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ The syntax for the environment variable is one of:

``PSYVERIFY__module__variable``
The specified variable name is tested in all kernel calls of the
specified module that are instrumented with the ValueRangeCheck
specified module that are instrumented with the ValueRangeCheckTrans
transformation.

``PSYVERIFY__variable``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
not infinity or NAN.
'''

from psyclone.psyir.transformations import ValueRangeCheck
from psyclone.psyir.transformations import ValueRangeCheckTrans


def trans(psy):
Expand All @@ -56,7 +56,7 @@ def trans(psy):
:rtype: :py:class:`psyclone.gocean1p0.GOPSy`
'''
value_range_check = ValueRangeCheck()
value_range_check = ValueRangeCheckTrans()

invoke = psy.invokes.get("invoke_0")
schedule = invoke.schedule
Expand Down
4 changes: 2 additions & 2 deletions src/psyclone/psyir/transformations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
from psyclone.psyir.transformations.loop_tiling_2d_trans \
import LoopTiling2DTrans
from psyclone.psyir.transformations.loop_trans import LoopTrans
from psyclone.psyir.transformations.value_range_check import ValueRangeCheck
from psyclone.psyir.transformations.value_range_check_trans import ValueRangeCheckTrans
from psyclone.psyir.transformations.omp_loop_trans import OMPLoopTrans
from psyclone.psyir.transformations.omp_target_trans import OMPTargetTrans
from psyclone.psyir.transformations.omp_taskwait_trans import OMPTaskwaitTrans
Expand Down Expand Up @@ -145,4 +145,4 @@
'RegionTrans',
'ReplaceInductionVariablesTrans',
'TransformationError',
'ValueRangeCheck']
'ValueRangeCheckTrans']
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import ReadOnlyVerifyTrans


class ValueRangeCheck(ReadOnlyVerifyTrans):
class ValueRangeCheckTrans(ReadOnlyVerifyTrans):
'''This transformation inserts a ValueRangeCheckNode into the PSyIR of a
schedule. At code creation time this node will use the PSyData API
to create code that will verify all input parameters are not NANs
Expand Down Expand Up @@ -103,4 +103,4 @@ def validate(self, node_list, options=None):

# ============================================================================
# For automatic documentation creation:
__all__ = ["ValueRangeCheck"]
__all__ = ["ValueRangeCheckTrans"]
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@
# Modified by: R. W. Ford, S. Siso and N. Nobre, STFC Daresbury Lab
# -----------------------------------------------------------------------------

''' Module containing tests for ValueRangeCheck and ValueRangeCheckNode
''' Module containing tests for ValueRangeCheckTrans and ValueRangeCheckNode
'''

import pytest


from psyclone.errors import InternalError
from psyclone.psyir.nodes import colored, Node, ValueRangeCheckNode, Schedule
from psyclone.psyir.transformations import (ValueRangeCheck,
from psyclone.psyir.transformations import (ValueRangeCheckTrans,
TransformationError)
from psyclone.tests.utilities import get_invoke
from psyclone.transformations import OMPParallelLoopTrans


# ---------------------------------------------------------------------------
def test_value_range_check_trans():
'''Tests basic functions in ValueRangeCheck.'''
value_range = ValueRangeCheck()
'''Tests basic functions in ValueRangeCheckTrans.'''
value_range = ValueRangeCheckTrans()
assert str(value_range) == ("Create a sub-tree of the PSyIR that has a "
"node of type ValueRangeCheckNode at its "
"root.")
assert value_range.name == "ValueRangeCheck"
assert value_range.name == "ValueRangeCheckTrans"


# -----------------------------------------------------------------------------
Expand All @@ -80,7 +80,7 @@ def test_value_range_check_basic():
'''
_, invoke = get_invoke("test11_different_iterates_over_one_invoke.f90",
"gocean", idx=0, dist_mem=False)
value_range_check = ValueRangeCheck()
value_range_check = ValueRangeCheckTrans()
value_range_check.apply(invoke.schedule[0].loop_body[0])
result = invoke.schedule.view()

Expand All @@ -100,7 +100,7 @@ def test_value_range_check_options():
'''
_, invoke = get_invoke("test11_different_iterates_over_one_invoke.f90",
"gocean", idx=0, dist_mem=False)
value_range_check = ValueRangeCheck()
value_range_check = ValueRangeCheckTrans()
value_range_check.apply(invoke.schedule[0].loop_body[0],
options={"region_name": ("a", "b")})
code = str(invoke.gen())
Expand All @@ -109,26 +109,26 @@ def test_value_range_check_options():

# -----------------------------------------------------------------------------
def test_invalid_apply():
'''Test the exceptions that should be raised by ValueRangeCheck.
'''Test the exceptions that should be raised by ValueRangeCheckTrans.
'''
_, invoke = get_invoke("test11_different_iterates_over_one_invoke.f90",
"gocean", idx=0)
value_range_check = ValueRangeCheck()
value_range_check = ValueRangeCheckTrans()
omp = OMPParallelLoopTrans()
omp.apply(invoke.schedule[0])
with pytest.raises(TransformationError) as err:
value_range_check.apply(invoke.schedule[0].dir_body[0],
options={"region_name": ("a", "b")})

assert "Error in ValueRangeCheck: Application to a Loop without its "\
assert "Error in ValueRangeCheckTrans: Application to a Loop without its "\
"parent Directive is not allowed." in str(err.value)

with pytest.raises(TransformationError) as err:
value_range_check.apply(invoke.schedule[0].dir_body[0].loop_body[0],
options={"region_name": ("a", "b")})

assert "Error in ValueRangeCheck: Application to Nodes enclosed within a "\
assert "Error in ValueRangeCheckTrans: Application to Nodes enclosed within a "\
"thread-parallel region is not allowed." in str(err.value)


Expand All @@ -143,7 +143,7 @@ def test_value_range_check_psyir_visitor(fortran_writer):
_, invoke = get_invoke("test11_different_iterates_over_one_invoke.f90",
"gocean", idx=0, dist_mem=False)

value_range_check = ValueRangeCheck()
value_range_check = ValueRangeCheckTrans()
value_range_check.apply(invoke.schedule,
options={"region_name": ("a", "b")})

Expand Down Expand Up @@ -181,7 +181,7 @@ def test_value_range_check_lfric():
psy, invoke = get_invoke("1.2_multi_invoke.f90", api="lfric",
idx=0, dist_mem=False)

value_range_check = ValueRangeCheck()
value_range_check = ValueRangeCheckTrans()
value_range_check.apply(invoke.schedule)

code = str(psy.gen)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ out of range error or an invalid value, an error message like the following will
NaN at index/indices 11


The transformation ``ValueRangeCheck`` is imported from ``psyclone.psyir.transformations``.
The transformation ``ValueRangeCheckTrans`` is imported from ``psyclone.psyir.transformations``.
You can use the template ``value_range_check_transform.py`` for your script,
and ``Makefile.value_range_check`` for the makefile to use.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
adds ValueRangeCheck code to the invokes.
'''

from psyclone.psyir.transformations import ValueRangeCheck
from psyclone.psyir.transformations import ValueRangeCheckTrans


def trans(psy):
Expand All @@ -52,7 +52,7 @@ def trans(psy):
:rtype: :py:class:`psyclone.psyGen.PSy`
'''
value_range_check = ValueRangeCheck()
value_range_check = ValueRangeCheckTrans()

for invoke_name in psy.invokes.names:

Expand Down

0 comments on commit 915988d

Please sign in to comment.