|
2 | 2 |
|
3 | 3 | from conftest import assert_structure |
4 | 4 | from devito import ( |
5 | | - Buffer, Eq, Function, Grid, Inc, Operator, SubDimension, SubDomain, TimeFunction, |
6 | | - solve |
| 5 | + NODE, Buffer, Eq, Function, Grid, Inc, Operator, SubDimension, SubDomain, |
| 6 | + TimeFunction, solve |
7 | 7 | ) |
8 | 8 | from devito.ir.iet import retrieve_iteration_tree |
9 | 9 | from devito.ir.support.properties import PARALLEL |
@@ -131,7 +131,7 @@ def test_issue_1921(): |
131 | 131 | assert np.all(g.data == g1.data) |
132 | 132 |
|
133 | 133 |
|
134 | | -def test_buffer1_fissioning(): |
| 134 | +def test_buffer1_v0(): |
135 | 135 | """ |
136 | 136 | Tests an edge case whereby inability to spot the equivalence of |
137 | 137 | `f.forward`/`backward` and `f` when using `Buffer(1)` would cause |
@@ -196,3 +196,23 @@ def define(self, dimensions): |
196 | 196 | # Two loop nests: free-surface-like and update-like |
197 | 197 | assert_structure(op, ['t,x,y,z', 't,x0_blk0,y0_blk0,x,y,z'], |
198 | 198 | 't,x,y,z,x0_blk0,y0_blk0,x,y,z') |
| 199 | + |
| 200 | + |
| 201 | +def test_buffer1_v1(): |
| 202 | + grid = Grid((11, 11, 11)) |
| 203 | + x, y, z = grid.dimensions |
| 204 | + |
| 205 | + image_vs = Function(name='image_vs', grid=grid, space_order=1, staggered=NODE) |
| 206 | + p_back_xy = TimeFunction(name='p_back_xy', grid=grid, staggered=(x, y), |
| 207 | + space_order=4, time_order=1, save=Buffer(1)) |
| 208 | + |
| 209 | + eqns = [Eq(image_vs, p_back_xy + image_vs), |
| 210 | + Eq(p_back_xy.backward, p_back_xy)] |
| 211 | + |
| 212 | + op = Operator(eqns) |
| 213 | + |
| 214 | + assert_structure( |
| 215 | + op, |
| 216 | + ['t,x0_blk0,y0_blk0,x,y,z', 't,x1_blk0,y1_blk0,x,y,z'], |
| 217 | + 'tx0_blk0y0_blk0xyzx1_blk0y1_blk0xyz' |
| 218 | + ) |
0 commit comments