Skip to content

Commit 8a227ea

Browse files
committed
compiler: fix terminal detection from dynamic dim bounds
1 parent 013bb51 commit 8a227ea

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

devito/symbolics/search.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def __init__(self, query: Callable[[Expression], bool], deep: bool = False) -> N
6060
def _next(self, expr: Expression) -> Iterable[Expression]:
6161
if self.deep and expr.is_Indexed:
6262
return expr.indices
63+
elif self.deep and q_dimension(expr):
64+
return expr.bound_symbols
6365
elif q_leaf(expr):
6466
return ()
6567
return expr.args

tests/test_dle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ def test_dynamic_nthreads(self):
755755
('[Eq(f, 2*f)]', [2, 0, 0], False),
756756
('[Eq(u, 2*u)]', [0, 2, 0, 0], False),
757757
('[Eq(u, 2*u + f)]', [0, 3, 0, 0, 0, 0, 0], True),
758-
('[Eq(u, 2*u), Eq(f, u.dzr)]', [0, 2, 0, 0, 0], False)
758+
('[Eq(u, 2*u), Eq(f, u.dzr)]', [0, 2, 0, 0, 2, 0, 0], False)
759759
])
760760
def test_collapsing(self, eqns, expected, blocking):
761761
grid = Grid(shape=(3, 3, 3))

tests/test_operator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,12 +1582,12 @@ def test_no_fission_as_illegal(self, exprs):
15821582
(('Eq(tu[t,x,y,z], tu[t,x,y,z] + tv[t,x,y,z])',
15831583
'Eq(tv[t,x,y,z], tu[t,x,y,z+2])',
15841584
'Eq(tu[t,x,y,0], tu[t,x,y,0] + 1.)'),
1585-
'+++++', ['txyz', 'txyz', 'txy'], 'txyzz'),
1585+
'+++++++', ['txyz', 'txyz', 'txy'], 'txyzxyz'),
15861586
# 7) WAR 1->2, 2->3
15871587
(('Eq(tu[t,x,y,z], tu[t,x,y,z] + tv[t,x,y,z])',
15881588
'Eq(tv[t,x,y,z], tu[t,x,y,z+2])',
15891589
'Eq(tw[t,x,y,z], tv[t,x,y,z-1] + 1.)'),
1590-
'++++++', ['txyz', 'txyz', 'txyz'], 'txyzzz'),
1590+
'++++++++', ['txyz', 'txyz', 'txyz'], 'txyzxyzz'),
15911591
# 8) WAR 1->2; WAW 1->3
15921592
(('Eq(tu[t,x,y,z], tu[t,x,y,z] + tv[t,x,y,z])',
15931593
'Eq(tv[t,x,y,z], tu[t,x+2,y,z])',
@@ -1597,7 +1597,7 @@ def test_no_fission_as_illegal(self, exprs):
15971597
(('Eq(tu[t,x,y,z], tu[t,x,y,z] + tv[t,x,y,z])',
15981598
'Eq(tv[t,x,y,z], tu[t,x,y,z-2])',
15991599
'Eq(tw[t,x,y,z], tv[t,x,y+1,z] + 1.)'),
1600-
'+++++++', ['txyz', 'txyz', 'txyz'], 'txyzzyz'),
1600+
'+++++++++', ['txyz', 'txyz', 'txyz'], 'txyzxyzyz'),
16011601
# 10) WAR 1->2; WAW 1->3
16021602
(('Eq(tu[t-1,x,y,z], tu[t,x,y,z] + tv[t,x,y,z])',
16031603
'Eq(tv[t,x,y,z], tu[t,x,y,z+2])',

0 commit comments

Comments
 (0)