Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler: Hotfix compare-ops #2251

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion devito/symbolics/inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def compare_ops(e1, e2):
return True if e1 == e2 else False
elif isinstance(e1, IndexDerivative) and isinstance(e2, IndexDerivative):
if e1.mapper == e2.mapper:
return compare_ops(e1.base, e2.base)
return compare_ops(e1.expr, e2.expr)
else:
return False
elif e1.is_Indexed and e2.is_Indexed:
Expand Down
15 changes: 15 additions & 0 deletions tests/test_unexpansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,21 @@ def test_v1(self):

op.cfunction

def test_diff_first_deriv(self):
grid = Grid(shape=(16, 16, 16))

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

eq = Eq(u.forward, u.dy2.dz + u.dy.dx + 1)

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

xs, ys, zs = get_params(op, 'x0_blk0_size', 'y0_blk0_size', 'z_size')
arrays = get_arrays(op)
assert len(arrays) == 2
check_array(arrays[0], ((8, 8), (0, 0), (8, 8)), (xs+16, ys, zs+16))
check_array(arrays[1], ((8, 8), (0, 0), (8, 8)), (xs+16, ys, zs+16))


def tti_sa_eqns(grid):
t = grid.stepping_dim
Expand Down
Loading