Skip to content

Commit 7633b6e

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

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

tests/test_fission.py

Lines changed: 21 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,23 @@ 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+
space_order = 2
135+
136+
A = VectorTimeFunction(name='A', grid=grid, save=Buffer(1), space_order=2,
137+
time_order=1, staggered=(x, y, z))
138+
B = VectorTimeFunction(name='B', grid=grid, save=Buffer(1), space_order=2,
139+
time_order=1, staggered=((y, z),(x, z),(x, y)))
140+
f = Function(name='f', grid=grid, space_order=2)
141+
142+
eqs = [Eq(B.forward, solve(Eq(curl(A), -B.dt), B.forward)),
143+
Eq(A.forward, solve(Eq(curl(B.forward), f*A.dt), A.forward))]
144+
145+
op = Operator(eqs, opt='fission')
146+
147+
assert_structure(op, ['t,x,y,z', 't,x,y,z'], 't,x,y,z,x,y,z')

0 commit comments

Comments
 (0)