Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3669444
#2951 Add kwargs and validate Reference2ArrayRange inside ArrayAssign…
sergisiso Jan 22, 2026
22d2db7
#2951 Update more error messages
sergisiso Jan 22, 2026
817e43c
#2951 Update lfric passthrough to parse all lfric_atm kernels
sergisiso Jan 22, 2026
26b01f5
#2951 Fix flake8
sergisiso Jan 22, 2026
47564ad
Merge remote-tracking branch 'origin/master' into 2951_improve_arraya…
sergisiso Jan 22, 2026
be73131
#2951 Revert lfric workflow changes
sergisiso Jan 23, 2026
41422f1
#2951 Continue cleaning up ArrayAssignment2Loop transformation
sergisiso Jan 23, 2026
301374a
#2951 Fix remaining issue
sergisiso Jan 23, 2026
dded124
Merge remote-tracking branch 'origin/master' into 2951_improve_arraya…
sergisiso Jan 23, 2026
9e78027
#2951 Fix issue with SIR backend
sergisiso Jan 26, 2026
c588129
#2951 Fix issues in get_effective_shape with nested ranges
sergisiso Jan 26, 2026
6951088
#2951 Add conservative version of ArrayAssignment2Loop dependency checks
sergisiso Jan 26, 2026
e6d0be3
#2951 Remove nemo exclusion
sergisiso Jan 26, 2026
17097ff
Merge remote-tracking branch 'origin/master' into 2951_improve_arraya…
sergisiso Jan 27, 2026
46d57e1
#2951 Add assert for missing coverage
sergisiso Jan 27, 2026
ce9d1c1
#2951 Improve arrayassignment2loop dependency checks
sergisiso Jan 27, 2026
49a809d
Merge remote-tracking branch 'origin/master' into 2951_improve_arraya…
sergisiso Jan 27, 2026
cd269e6
#2951 Remove excluded NEMO file
sergisiso Jan 27, 2026
60c6d1d
#2951 Recover previously commented test case
sergisiso Jan 27, 2026
6bb0bfa
Merge remote-tracking branch 'origin/master' into 2951_improve_arraya…
sergisiso Feb 10, 2026
26bc41b
#2951 Fix ArrayAssignment2LoopsTrans validate kwargs
sergisiso Feb 11, 2026
b386cda
Merge remote-tracking branch 'origin/master' into 2951_improve_arraya…
sergisiso Feb 11, 2026
814b134
#2951 Improve arrayassignment2loop validation
sergisiso Feb 11, 2026
0f9fad7
Merge remote-tracking branch 'origin/master' into 2951_improve_arraya…
sergisiso Feb 11, 2026
c3391bb
Merge branch 'master' into 2951_improve_arrayassignment2loop
LonelyCat124 Feb 12, 2026
0a02cef
#2951 Improve ArrayAssignment2Loops comments and fix issue with NEMO …
sergisiso Feb 13, 2026
3cf6c36
Merge remote-tracking branch 'origin/master' into 2951_improve_arraya…
sergisiso Feb 13, 2026
6bd7443
Merge branch 'master' into 2951_improve_arrayassignment2loop
arporter Feb 16, 2026
ea0b731
#2951 Improve arrayassignment2loop implementation
sergisiso Feb 17, 2026
595ecf8
Merge remote-tracking branch 'origin/master' into 2951_improve_arraya…
sergisiso Feb 17, 2026
9bd0a8f
#2951 Revert SIR changes
sergisiso Feb 17, 2026
5efd486
#2951 Ignore errors in SIR nemo examples
sergisiso Feb 17, 2026
e72ab2e
Merge branch 'master' into 2951_improve_arrayassignment2loop
sergisiso Feb 17, 2026
0842a33
#2951 update changelog
arporter Feb 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
48) PR #3296 for #2951. Improves ArrayAssignment2LoopTrans to allow
for dependencies between LHS and RHS.

47) PR #3332 for #3143 - fixes bug in DependenceUseChain so that
previous access of a call argument does not return the call.

Expand Down
7 changes: 5 additions & 2 deletions examples/nemo/eg4/sir_trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@ def trans(psyir):
sir_writer = SIRWriter()
for subroutine in psyir.walk(Routine):
print(f"Transforming subroutine: {subroutine.name}")
sir_code = sir_writer(subroutine)
print(sir_code)
try:
sir_code = sir_writer(subroutine)
print(sir_code)
except Exception as e:
print(f"Failed to transform {subroutine.name}: {e}")
7 changes: 5 additions & 2 deletions examples/nemo/eg4/sir_trans_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,8 @@ def trans(psyir):

kern = fortran_writer(subroutine)
print(kern)
kern = sir_writer(subroutine)
print(kern)
try:
kern = sir_writer(subroutine)
print(kern)
except Exception as e:
print(f"Failed to transform {subroutine.name}: {e}")
11 changes: 7 additions & 4 deletions examples/nemo/eg4/sir_trans_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def trans(psyir):
if isinstance(child, Assignment):
hoist_trans.apply(child)

kern = sir_writer(subroutine)
# TODO issue #1854. There should be backend support for
# writing out SIR.
print(kern)
try:
kern = sir_writer(subroutine)
# TODO issue #1854. There should be backend support for
# writing out SIR.
print(kern)
except Exception as e:
print(f"Failed to transform {subroutine.name}: {e}")
9 changes: 5 additions & 4 deletions examples/nemo/scripts/omp_gpu_trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@

NEMOV4_EXCLUSIONS = [
"dynspg_ts.f90",
"tranxt.f90",
]

SKIP_FOR_PERFORMANCE = [
Expand Down Expand Up @@ -191,12 +190,14 @@ def trans(psyir):
subroutine.name == 'dom_zgr' or
subroutine.name == 'dom_ngb'):
continue
if subroutine.name == "solfrac_mod.f90":
if subroutine.name == "solfrac":
# Bring these solfrac parameters to the subroutine as nvidia
# does not permit offloaded kernels to access module parameters
symtab = subroutine.symbol_table
symtab.add(symtab.lookup("pp_wgt"))
symtab.add(symtab.lookup("pp_len"))
if "pp_wgt" not in symtab:
symtab.add(symtab.lookup("pp_wgt"))
if "pp_len" not in symtab:
symtab.add(symtab.lookup("pp_len"))

normalise_loops(
subroutine,
Expand Down
3 changes: 0 additions & 3 deletions examples/nemo/scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,6 @@ def normalise_loops(
# Convert all array implicit loops to explicit loops
explicit_loops = ArrayAssignment2LoopsTrans()
for assignment in schedule.walk(Assignment):
# TODO #2951: Fix array assignments with dependencies
if schedule.name in ("fld_def",):
continue
try:
explicit_loops.apply(
assignment, options={'verbose': True})
Expand Down
4 changes: 2 additions & 2 deletions src/psyclone/psyir/nodes/array_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ def _get_effective_shape(self):
dtype = idx_expr.datatype
if isinstance(dtype, ArrayType):
# An array slice can be defined by a 1D slice of another
# array, e.g. `a(b(1:4))` or `a(b)`.
# array, e.g. `a(b(1:4))`, `a(b)` or a(b(:)).
indirect_array_shape = dtype.shape
if len(indirect_array_shape) > 1:
raise NotImplementedError(
Expand All @@ -655,7 +655,7 @@ def _get_effective_shape(self):
f"{len(indirect_array_shape)} dimensions.")
# pylint: disable=protected-access
if isinstance(idx_expr, ArrayMixin):
shape.append(idx_expr._extent(idx))
shape.append(idx_expr._get_effective_shape()[0])
else:
# We have some expression with a shape but no explicit
# indexing. The extent of this is then the SIZE of
Expand Down
Loading
Loading