Skip to content

Commit

Permalink
#1823 Imporve module-inline docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
sergisiso committed Oct 7, 2022
1 parent ab3811f commit b31da81
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,10 @@ class KernelModuleInlineTrans(Transformation):
>>> # print(schedule.view())
.. warning ::
For this transformation to work correctly, the Kernel subroutine
must only use data that is passed in by argument, declared locally
or included via use association within the subroutine. Two
examples where in-lining will not work are:
Not all kernels subroutines can be module-inlined. This transformation
will reject attempts to in-line kernels that access global data in the
original module.
#. A variable is declared within the module that ``contains`` the
Kernel subroutine and is then accessed within that Kernel;
#. A variable is included via use association at the module level
and accessed within the Kernel subroutine.
The transformation will reject attempts to in-line such kernels.
'''

def __str__(self):
Expand Down Expand Up @@ -169,6 +162,7 @@ def _prepare_code_to_inline(code_to_inline):
:type code_to_inline: :py:class:`psyclone.psyir.node.Routine`
'''
# pylint: disable=too-many-branches
source_container = code_to_inline.ancestor(Container)

# First make a set with all symbols used inside the subroutine
Expand Down

0 comments on commit b31da81

Please sign in to comment.