-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(closes #1010, #1910, #719, #798, #1648) Generate PSy-layers and Kernel Subs using PSyIR lowering (instead of gen_code/f2pygen) #2834
base: master
Are you sure you want to change the base?
Changes from 13 commits
bc49de6
a3e1b35
e864bc2
df68488
cd515be
0b90f7b
96c1aa6
5c74c42
e661950
64a6bfd
6c55316
93f88f3
77fe7ff
99ffbbe
99422e6
9be02af
2481022
decd073
0e05a0b
ef34fa1
62e41e5
8908239
930ddb9
a2942f1
cf63302
3d8969c
98a899c
ddef4de
b697236
6ab2c8c
bbb31da
6bf1383
6787c5e
960855f
0d0d8e3
0cdb879
4c74023
5c08043
35180f8
2a556b2
990afa5
46eee5c
d3dab2d
3ac82c5
e8bfe66
d83f380
8183b8a
55a4eaa
225d346
17f6749
84f96e3
c9938f3
50ad16c
3cc4589
c719f11
f0c87d2
d398ed2
2a3fe85
b0d5e98
009006f
14e0b23
eee5c9c
e3d2f2e
501655a
82d8706
a5c50fd
b134171
300afee
08e9221
a0d5e2f
0fb3098
1f97c15
cfcc44d
39c3037
9edd419
298fa90
ea78b6f
cf32395
9558dc4
43a0e83
d1ab352
7cae96a
ecd20d3
b81e2ed
b3a3d82
dbac36c
5a7b0a6
36af0bf
abc2feb
0ffbb70
65afad9
c754874
713a758
bbf58ab
f3d3574
b7cb593
7d3ab2a
b9a64c1
9ff9eae
dc1c142
3ab9c4d
852a826
1dd394e
5d7d712
5dc9ec0
e90cbcf
3a4b983
3a18bb3
cd18e86
6ddb65e
c345f0a
9ec3f54
57db171
92fed41
bb53018
1a06860
cdb2399
0614d93
d7fcd56
1a67f95
5d66448
ac88bd0
6ac84f3
6cef2df
fe26a76
7040b7c
5996da2
8db5dfa
bbae102
0bdb80c
973d654
8ac5de3
6dccea4
0fcbc51
b2049ad
4fd0beb
ada35dc
71f85e2
55341ea
b005d8f
c1481f1
cd5b832
17b73c1
b6d1ff9
9e1a888
b09a941
e2c7464
434b0c3
f4c2ebf
ba10989
eff7b5c
226302a
8033d65
f8bc89a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ class for all API-specific loop fusion transformations. | |
|
||
from psyclone.core import SymbolicMaths | ||
from psyclone.domain.common.psylayer import PSyLoop | ||
from psyclone.psyir.nodes import Reference | ||
from psyclone.psyir.nodes import Reference, Routine | ||
from psyclone.psyir.tools import DependencyTools | ||
from psyclone.psyir.transformations.loop_trans import LoopTrans | ||
from psyclone.psyir.transformations.transformation_error import \ | ||
|
@@ -198,6 +198,21 @@ def apply(self, node1, node2, options=None): | |
# Add loop contents of node2 to node1 | ||
node1.loop_body.children.extend(node2.loop_body.pop_all_children()) | ||
|
||
# We need to remove all leftover references because lfric is compiled | ||
# with '-Werror=unused-variable' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could add: ". Since we have fused loops, we only need to look at the symbols appearing in the loop control of the second loop." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
routine = node1.ancestor(Routine) | ||
if routine: | ||
remaining_syms = [r.symbol for r in routine.walk(Reference)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm unsure whether it would be better here to use:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am slightly nervous that Signatures still operate on strings and can't differentiate between symbols with the same name in different scopes, but I think is the right thing to do here, so I updated to it. |
||
del_syms = [r.symbol for r in node2.start_expr.walk(Reference) + | ||
node2.stop_expr.walk(Reference)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strictly speaking, we should allow for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
for rsym in del_syms: | ||
if rsym not in remaining_syms: | ||
if rsym.is_automatic: | ||
symtab = rsym.find_symbol_table(node1) | ||
# TODO #898: Implement symbol removal | ||
# pylint: disable=protected-access | ||
symtab._symbols.pop(rsym.name) | ||
|
||
|
||
# For automatic documentation generation | ||
__all__ = ["LoopFuseTrans"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,8 @@ | |
from psyclone.configuration import Config | ||
from psyclone.psyir.nodes import ( | ||
OMPDoDirective, OMPLoopDirective, OMPParallelDoDirective, | ||
OMPTeamsDistributeParallelDoDirective, OMPScheduleClause) | ||
OMPTeamsLoopDirective, OMPTeamsDistributeParallelDoDirective, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverted |
||
OMPScheduleClause) | ||
from psyclone.psyir.transformations.parallel_loop_trans import \ | ||
ParallelLoopTrans | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably you meant
tag
without the quotes? That might then fix the coverage issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, that's embarrassing, that also fixes the first issue reported by @TeranIvy