Skip to content

Commit ad447a3

Browse files
committed
compiler: Improve alias scheduling
1 parent a00cca8 commit ad447a3

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

devito/passes/clusters/aliases.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ def collect(extracted, ispace, minstorage):
525525
k = group.dimensions_translated
526526
else:
527527
k = group.dimensions
528+
k = frozenset(d for d in k if not d.is_NonlinearDerived)
528529
mapper.setdefault(k, []).append(group)
529530

530531
aliases = AliasList()

tests/test_dse.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,6 +2664,25 @@ def test_sparse_const(self):
26642664
op()
26652665
assert np.all(src.data == 8)
26662666

2667+
def test_space_and_time_invariant_together(self):
2668+
grid = Grid(shape=(34, 45, 50))
2669+
2670+
a = Function(name='a', grid=grid, space_order=8)
2671+
vx = TimeFunction(name='vx', grid=grid, space_order=8)
2672+
tzz = vx.func(name='tzz')
2673+
2674+
eqn = Eq(tzz.forward, a.dy.dz * (vx.dx.dy + vx.dx.dz) + tzz)
2675+
2676+
op = Operator(eqn, opt=('advanced', {'openmp': False}))
2677+
2678+
op.cfunction
2679+
2680+
assert_structure(
2681+
op,
2682+
['t,x0_blk0,y0_blk0,x,y,z', 't,x0_blk0,y0_blk0,x,y,z'],
2683+
'tx0_blk0y0_blk0xyzyz'
2684+
)
2685+
26672686

26682687
class TestIsoAcoustic:
26692688

0 commit comments

Comments
 (0)