Skip to content

Commit bc2281c

Browse files
committed
compiler: Improve loop fission
1 parent 59d7919 commit bc2281c

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/test_fission.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from conftest import assert_structure
44
from devito import (Eq, Inc, Grid, Function, TimeFunction, SubDimension, SubDomain,
5-
Operator, solve)
5+
Operator, VectorTimeFunction, Buffer, curl, solve)
66

77

88
def test_issue_1725():
@@ -125,3 +125,21 @@ def test_issue_1921():
125125
op1.apply(time_m=1, time_M=5, g=g1)
126126

127127
assert np.all(g.data == g1.data)
128+
129+
130+
def test_fission_largest_cluster():
131+
grid = Grid(shape=(10, 10, 10))
132+
x, y, z = grid.dimensions
133+
134+
A = VectorTimeFunction(name='A', grid=grid, save=Buffer(1), space_order=2,
135+
time_order=1, staggered=(x, y, z))
136+
B = VectorTimeFunction(name='B', grid=grid, save=Buffer(1), space_order=2,
137+
time_order=1, staggered=((y, z), (x, z), (x, y)))
138+
f = Function(name='f', grid=grid, space_order=2)
139+
140+
eqs = [Eq(B.forward, solve(Eq(curl(A), -B.dt), B.forward)),
141+
Eq(A.forward, solve(Eq(curl(B.forward), f*A.dt), A.forward))]
142+
143+
op = Operator(eqs, opt='fission')
144+
145+
assert_structure(op, ['t,x,y,z', 't,x,y,z'], 't,x,y,z,x,y,z')

0 commit comments

Comments
 (0)