|
35 | 35 | from devito.passes.iet.languages.C import CDataManager |
36 | 36 | from devito.symbolics import ListInitializer, indexify, retrieve_indexed |
37 | 37 | from devito.tools import flatten, powerset, timed_region |
38 | | -from devito.types import Array, Barrier, CustomDimension, Indirection, Scalar, Symbol |
| 38 | +from devito.types import ( |
| 39 | + Array, Barrier, CustomDimension, Indirection, Scalar, Symbol, ConditionalDimension |
| 40 | +) |
39 | 41 |
|
40 | 42 |
|
41 | 43 | def dimify(dimensions): |
@@ -2034,6 +2036,23 @@ def test_2194_v2(self, eqns, expected, exp_trees, exp_iters): |
2034 | 2036 | op.apply() |
2035 | 2037 | assert(np.all(u.data[:] == expected[:])) |
2036 | 2038 |
|
| 2039 | + def test_pseudo_time_dep(self): |
| 2040 | + """ |
| 2041 | + Test that a data dependency through a field is correctly |
| 2042 | + ignored when not direction dependent |
| 2043 | + """ |
| 2044 | + grid = Grid((11, 11)) |
| 2045 | + ct = ConditionalDimension(name='ct', parent=grid.time_dim, factor=2) |
| 2046 | + f = TimeFunction(name='f', grid=grid, time_order=1) |
| 2047 | + g = Function(name='g', grid=grid) |
| 2048 | + |
| 2049 | + eq = [Eq(f.backward, div(f) + 1), |
| 2050 | + Eq(g, g + f.symbolic_shape[1], implicit_dims=ct), |
| 2051 | + Eq(g, g + 1, implicit_dims=ct)] |
| 2052 | + op = Operator(eq) |
| 2053 | + |
| 2054 | + assert_structure(op, ['t,x,y', 't', 't,x,y'], 't,x,y,x,y') |
| 2055 | + |
2037 | 2056 |
|
2038 | 2057 | class TestInternals: |
2039 | 2058 |
|
|
0 commit comments