Skip to content

Commit

Permalink
compiler: Patch unexpansion with double precision
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioLuporini committed Sep 21, 2023
1 parent b23d8ed commit a96a803
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion devito/passes/clusters/derivatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _core(expr, c, weights, mapper, sregistry):
try:
w = weights[k]
except KeyError:
w = weights[k] = w0._rebuild(name=name)
w = weights[k] = w0._rebuild(name=name, dtype=expr.dtype)
expr = uxreplace(expr, {w0.indexed: w.indexed})

dims = retrieve_dimensions(expr, deep=True)
Expand Down
14 changes: 14 additions & 0 deletions tests/test_unexpansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,20 @@ def test_v1(self):
op.cfunction


class TestMisc(object):

def test_double_precision(self):
grid = Grid(shape=(10, 10, 10), dtype=np.float64)

u = TimeFunction(name='u', grid=grid, space_order=4)

eqns = Eq(u.forward, u.laplace + 1.)

op = Operator(eqns, opt=('advanced', {'expand': False}))

op.cfunction


def tti_sa_eqns(grid):
t = grid.stepping_dim
x, y, z = grid.dimensions
Expand Down

0 comments on commit a96a803

Please sign in to comment.