|
5 | 5 | import pytest |
6 | 6 | from sympy import And, Or |
7 | 7 |
|
8 | | -from conftest import assert_blocking, assert_structure, opts_tiling, skipif |
| 8 | +from conftest import assert_blocking, assert_structu_re, opts_tiling, skipif |
9 | 9 | from devito import ( # noqa |
10 | 10 | Buffer, ConditionalDimension, Constant, CustomDimension, DefaultDimension, Dimension, |
11 | 11 | Eq, Function, Ge, Grid, Gt, Inc, Le, Lt, Ne, Operator, SpaceDimension, SparseFunction, |
@@ -715,7 +715,7 @@ def test_subdim_blocked_w_partial_reuse(self): |
715 | 715 | op = Operator(eqns) |
716 | 716 |
|
717 | 717 | # Check generated code -- expected loop blocking |
718 | | - # Note that loop structure means zr is renamed to z to remove clutter |
| 718 | + # Note that loop structu_re means zr is renamed to z to remove clutter |
719 | 719 | assert_structure(op, |
720 | 720 | ['t,x0_blk0,y0_blk0,x,y,z', 't,x0_blk0,y0_blk0,x,y,z'], |
721 | 721 | 't,x0_blk0,y0_blk0,x,y,z,z') |
@@ -1482,16 +1482,16 @@ def test_stepping_dim_in_condition_lowering(self): |
1482 | 1482 | grid = Grid(shape=(4, 4)) |
1483 | 1483 | _, y = grid.dimensions |
1484 | 1484 |
|
1485 | | - ths = 10 |
| 1485 | + threshold = 10 |
1486 | 1486 | g = TimeFunction(name='g', grid=grid) |
1487 | 1487 |
|
1488 | | - ci = ConditionalDimension(name='ci', parent=y, condition=Le(g, ths)) |
| 1488 | + ci = ConditionalDimension(name='ci', parent=y, condition=Le(g, threshold)) |
1489 | 1489 |
|
1490 | 1490 | op = Operator(Eq(g.forward, g + 1, implicit_dims=ci)) |
1491 | 1491 |
|
1492 | | - op.apply(time_M=ths+3) |
1493 | | - assert np.all(g.data[0, :, :] == ths) |
1494 | | - assert np.all(g.data[1, :, :] == ths + 1) |
| 1492 | + op.apply(time_M=threshold+3) |
| 1493 | + assert np.all(g.data[0, :, :] == threshold) |
| 1494 | + assert np.all(g.data[1, :, :] == threshold + 1) |
1495 | 1495 | assert 'if (g[t0][x + 1][y + 1] <= 10)\n' |
1496 | 1496 | '{\n g[t1][x + 1][y + 1] = g[t0][x + 1][y + 1] + 1' in str(op.ccode) |
1497 | 1497 |
|
@@ -1809,24 +1809,24 @@ def test_issue_2007(self): |
1809 | 1809 | # proxy integral |
1810 | 1810 | f.data[:] = np.array(freq[:]) |
1811 | 1811 | # Proxy Fourier integral holder |
1812 | | - ure = Function(name="ure", grid=grid, |
| 1812 | + u_re = Function(name="u_re", grid=grid, |
1813 | 1813 | dimensions=(freq_dim,) + u.indices[1:], |
1814 | 1814 | shape=(nfreq,) + u.shape[1:]) |
1815 | 1815 |
|
1816 | 1816 | # ConditionalDimension based on `f` to simulate bounds of Fourier integral |
1817 | 1817 | ct = ConditionalDimension(name="ct", parent=time, condition=Ge(time, f)) |
1818 | 1818 | eqns = [ |
1819 | 1819 | Eq(u.forward, u+1), |
1820 | | - Eq(ure, ure + u, implicit_dims=ct) |
| 1820 | + Eq(u_re, u_re + u, implicit_dims=ct) |
1821 | 1821 | ] |
1822 | 1822 |
|
1823 | 1823 | op = Operator(eqns) |
1824 | 1824 |
|
1825 | 1825 | op.apply(time_M=10) |
1826 | 1826 |
|
1827 | | - assert np.all(ure.data[0] == 54) |
1828 | | - assert np.all(ure.data[1] == 49) |
1829 | | - assert np.all(ure.data[2] == 27) |
| 1827 | + assert np.all(u_re.data[0] == 54) |
| 1828 | + assert np.all(u_re.data[1] == 49) |
| 1829 | + assert np.all(u_re.data[2] == 27) |
1830 | 1830 |
|
1831 | 1831 | # Make sure the ConditionalDimension is at the right depth for performance |
1832 | 1832 | trees = retrieve_iteration_tree(op) |
|
0 commit comments