PSyclone
PSyclone copied to clipboard
array notation to array range transformation (closes #1576)
Will also be implemented in PSyAD as part of the preprocessing.
Need to add tests, doc string example for transformation, update documentation and look at dotproduct transformation to see how the bounds are determined - as we currently just add lbound and ubound whereas the dotproduct transformation provides actual values from the array declaration where possible.
Also currently failing for PSyAD with helmholtz_operator_kernel
(but seems to work for w2_to_w1_projection_kernel
).
Codecov Report
Base: 99.51% // Head: 99.51% // Increases project coverage by +0.00%
:tada:
Coverage data is based on head (
366ee20
) compared to base (fa0b77e
). Patch coverage: 100.00% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## master #1825 +/- ##
=======================================
Coverage 99.51% 99.51%
=======================================
Files 268 269 +1
Lines 39347 39380 +33
=======================================
+ Hits 39155 39188 +33
Misses 192 192
Impacted Files | Coverage Δ | |
---|---|---|
src/psyclone/psyir/frontend/fparser2.py | 100.00% <ø> (ø) |
|
src/psyclone/psyir/transformations/__init__.py | 100.00% <100.00%> (ø) |
|
...syir/transformations/reference2arrayrange_trans.py | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Ready for first review from @arporter or @sergisiso. This transformation returns the bounds of the array range if they can be determined. I think this is the right thing to do, rather than just returning ':'.
The PSyAD part has been dropped as the implementation does not work with the dotproduct transformation, which needs modifying.
I removed the #1576 todo in fparser2.py
as it changes the code to use loop variables rather than ":" notation which is not relevant to what we are doing here.
Ready for next review from @arporter
Added a test showing that an array within a structure causes the transformation to raise an exception. Also added a new issue #1858 about supporting arrays within structures and referenced this issue in the transformation.
Removed unnecessary import from test file.
Ready for next review from @arporter
I've hopefully made the required changes. Ready for another look from @arporter.