psyclone.psyir.transformations.read_only_verify_trans#
This module contains the base class for verifying read-only access in a region of code.”
Classes#
ReadOnlyVerifyTrans: This transformation inserts a ReadOnlyVerifyNode or a node derived
- class psyclone.psyir.transformations.read_only_verify_trans.ReadOnlyVerifyTrans(node_class=<class 'psyclone.psyir.nodes.read_only_verify_node.ReadOnlyVerifyNode'>)[source]#
This transformation inserts a ReadOnlyVerifyNode or a node derived from ReadOnlyVerifyNode into the PSyIR of a schedule. At code creation time this node will use the PSyData API to create code that will verify that read-only quantities are not modified.
After applying the transformation the Nodes marked for verification are children of the ReadOnlyVerifyNode. Nodes to verify can be individual constructs within an Invoke (e.g. Loops containing a Kernel or BuiltIn call) or entire Invokes.
- Parameters:
node_class (
psyclone.psyir.nodes.ReadOnlyVerifyNodeor derived class) – The class of Node which will be inserted into the tree (defaults to ReadOnlyVerifyNode), but can be any derived class.
Inheritance

- validate(node_list, options=None)[source]#
Performs validation checks specific to read-only-based transformations.
- Parameters:
node_list (list of
psyclone.psyir.nodes.Node) – the list of Node(s) we are checking.options (Optional[Dict[str, Any]]) – a dictionary with options for transformations.
- Raises:
TransformationError – if transformation is applied to a Kernel or a BuiltIn call without its parent Loop.
TransformationError – if transformation is applied to a Loop without its parent Directive when optimisations are applied.
TransformationError – if transformation is applied to an orphaned Directive without its parent Directive.