Reference Guide  2.5.0
__init__.py
1 # -----------------------------------------------------------------------------
2 # BSD 3-Clause License
3 #
4 # Copyright (c) 2020-2024, Science and Technology Facilities Council.
5 # All rights reserved.
6 #
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions are met:
9 #
10 # * Redistributions of source code must retain the above copyright notice, this
11 # list of conditions and the following disclaimer.
12 #
13 # * Redistributions in binary form must reproduce the above copyright notice,
14 # this list of conditions and the following disclaimer in the documentation
15 # and/or other materials provided with the distribution.
16 #
17 # * Neither the name of the copyright holder nor the names of its
18 # contributors may be used to endorse or promote products derived from
19 # this software without specific prior written permission.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 # POSSIBILITY OF SUCH DAMAGE.
33 # -----------------------------------------------------------------------------
34 # Author S. Siso, STFC Daresbury Lab
35 # Modified: A. R. Porter, R. W. Ford and N. Nobre, STFC Daresbury Lab
36 # Modified: J. Henrichs, Bureau of Meteorology
37 # Modified: A. B. G. Chalk, STFC Daresbury Lab
38 # -----------------------------------------------------------------------------
39 
40 ''' PSyIR nodes package module '''
41 
42 from psyclone.psyir.nodes.acc_clauses import (ACCCopyClause, ACCCopyInClause,
43  ACCCopyOutClause)
44 from psyclone.psyir.nodes.array_reference import ArrayReference
46  ArrayOfStructuresReference)
47 from psyclone.psyir.nodes.assignment import Assignment
48 from psyclone.psyir.nodes.codeblock import CodeBlock
49 from psyclone.psyir.nodes.container import Container
50 from psyclone.psyir.nodes.node import colored, Node
51 from psyclone.psyir.nodes.scoping_node import ScopingNode
52 from psyclone.psyir.nodes.schedule import Schedule
53 from psyclone.psyir.nodes.return_stmt import Return
54 from psyclone.psyir.nodes.array_member import ArrayMember
56  ArrayOfStructuresMember)
58  Operation, UnaryOperation, BinaryOperation)
59 from psyclone.psyir.nodes.literal import Literal
60 from psyclone.psyir.nodes.if_block import IfBlock
61 from psyclone.psyir.nodes.intrinsic_call import IntrinsicCall
62 from psyclone.psyir.nodes.reference import Reference
63 from psyclone.psyir.nodes.loop import Loop
64 from psyclone.psyir.nodes.extract_node import ExtractNode
65 from psyclone.psyir.nodes.kernel_schedule import KernelSchedule
66 from psyclone.psyir.nodes.member import Member
67 from psyclone.psyir.nodes.nan_test_node import NanTestNode
68 from psyclone.psyir.nodes.profile_node import ProfileNode
69 from psyclone.psyir.nodes.psy_data_node import PSyDataNode
70 from psyclone.psyir.nodes.read_only_verify_node import ReadOnlyVerifyNode
71 from psyclone.psyir.nodes.ranges import Range
72 from psyclone.psyir.nodes.routine import Routine
73 from psyclone.psyir.nodes.datanode import DataNode
74 from psyclone.psyir.nodes.statement import Statement
75 from psyclone.psyir.nodes.structure_reference import StructureReference
76 from psyclone.psyir.nodes.structure_member import StructureMember
77 from psyclone.psyir.nodes.call import Call
78 from psyclone.psyir.nodes.file_container import FileContainer
80  Directive, StandaloneDirective, RegionDirective)
82  DynamicOMPTaskDirective)
84  ACCDirective, ACCLoopDirective, ACCEnterDataDirective,
85  ACCParallelDirective, ACCKernelsDirective, ACCDataDirective,
86  ACCUpdateDirective, ACCStandaloneDirective, ACCRegionDirective,
87  ACCRoutineDirective, ACCAtomicDirective)
89  OMPDirective, OMPDoDirective, OMPParallelDirective,
90  OMPParallelDoDirective, OMPSingleDirective, OMPMasterDirective,
91  OMPSerialDirective, OMPTaskloopDirective, OMPTaskwaitDirective,
92  OMPStandaloneDirective, OMPRegionDirective, OMPTargetDirective,
93  OMPLoopDirective, OMPDeclareTargetDirective,
94  OMPTeamsDistributeParallelDoDirective, OMPAtomicDirective,
95  OMPSimdDirective)
96 from psyclone.psyir.nodes.clause import Clause, OperandClause
98  OMPGrainsizeClause, OMPNogroupClause, OMPNowaitClause, OMPNumTasksClause,
99  OMPPrivateClause, OMPDefaultClause, OMPReductionClause, OMPScheduleClause,
100  OMPFirstprivateClause, OMPSharedClause, OMPDependClause)
101 from psyclone.psyir.nodes.omp_task_directive import OMPTaskDirective
102 from psyclone.psyir.nodes.while_loop import WhileLoop
103 
104 # The entities in the __all__ list are made available to import directly from
105 # this package e.g. 'from psyclone.psyir.nodes import Literal'
106 __all__ = [
107  'colored',
108  'ArrayMember',
109  'ArrayReference',
110  'ArrayOfStructuresMember',
111  'ArrayOfStructuresReference',
112  'Assignment',
113  'BinaryOperation',
114  'Call',
115  'Clause',
116  'CodeBlock',
117  'Container',
118  'DataNode',
119  'FileContainer',
120  'IfBlock',
121  'IntrinsicCall',
122  'Literal',
123  'Loop',
124  'Member',
125  'Node',
126  'OperandClause',
127  'Operation',
128  'Range',
129  'Reference',
130  'Return',
131  'Routine',
132  'Schedule',
133  'Statement',
134  'StructureMember',
135  'StructureReference',
136  'UnaryOperation',
137  'ScopingNode',
138  'WhileLoop',
139  # PSyclone-specific nodes
140  'KernelSchedule',
141  # PSyData Nodes
142  'PSyDataNode',
143  'ExtractNode',
144  'ProfileNode',
145  'NanTestNode',
146  'ReadOnlyVerifyNode',
147  # Directive Nodes
148  'Directive',
149  'RegionDirective',
150  'StandaloneDirective',
151  # OpenACC Directive Nodes
152  'ACCAtomicDirective',
153  'ACCDirective',
154  'ACCRegionDirective',
155  'ACCStandaloneDirective',
156  'ACCDataDirective',
157  'ACCEnterDataDirective',
158  'ACCParallelDirective',
159  'ACCLoopDirective',
160  'ACCKernelsDirective',
161  'ACCUpdateDirective',
162  'ACCRoutineDirective',
163  # OpenACC Clause Nodes
164  'ACCCopyClause',
165  'ACCCopyInClause',
166  'ACCCopyOutClause',
167  # OpenMP Directive Nodes
168  'OMPAtomicDirective',
169  'OMPDirective',
170  'OMPRegionDirective',
171  'OMPStandaloneDirective',
172  'OMPParallelDirective',
173  'OMPSerialDirective',
174  'OMPSingleDirective',
175  'OMPMasterDirective',
176  'OMPTaskloopDirective',
177  'OMPTaskDirective',
178  'DynamicOMPTaskDirective',
179  'OMPDoDirective',
180  'OMPParallelDoDirective',
181  'OMPTaskwaitDirective',
182  'OMPTargetDirective',
183  'OMPLoopDirective',
184  'OMPDeclareTargetDirective',
185  'OMPSimdDirective',
186  'OMPTeamsDistributeParallelDoDirective',
187  # OMP Clause Nodes
188  'OMPGrainsizeClause',
189  'OMPNogroupClause',
190  'OMPNowaitClause',
191  'OMPNumTasksClause',
192  'OMPPrivateClause',
193  'OMPDefaultClause',
194  'OMPReductionClause',
195  'OMPScheduleClause',
196  'OMPFirstprivateClause',
197  'OMPSharedClause',
198  'OMPDependClause'
199  ]