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

DSE uses wrong np.dtype for some temporaries #920

Closed
FabioLuporini opened this issue Sep 3, 2019 · 0 comments · Fixed by #2128
Closed

DSE uses wrong np.dtype for some temporaries #920

FabioLuporini opened this issue Sep 3, 2019 · 0 comments · Fixed by #2128
Labels

Comments

@FabioLuporini
Copy link
Contributor

Reproducer below

import numpy as np
from devito import Grid, Function, Eq, Operator, generic_derivative


a = np.arange(64).reshape((8, 8))
grid = Grid(shape=a.shape, extent=(8, 8))

so = 3
dims = grid.dimensions
f = Function(name='f', grid=grid, space_order=so, dtype=np.int32)
f.data[:] = a

fo = Function(name='fo', grid=grid, space_order=so, dtype=np.int32)

expr = Eq(fo, f.dx)

op = Operator(expr)
op.apply()

basically the DSE generates int r0 = 1.0/h_x;, inferring int from the dtype of the searched expression. But then r0 will be 0, and so everything will be 0 at the end. We may wanna force the temporary dtype to float. Have to think about the potential side effects of doing that though

@FabioLuporini FabioLuporini changed the title DSE uses wrong np.dtype for certain temporaries DSE uses wrong np.dtype for some temporaries Sep 3, 2019
mloubout added a commit that referenced this issue Jun 29, 2023
mloubout added a commit that referenced this issue Jul 17, 2023
mloubout added a commit that referenced this issue Jul 20, 2023
mloubout added a commit that referenced this issue Jul 21, 2023
mloubout added a commit that referenced this issue Jul 21, 2023
mloubout added a commit that referenced this issue Jul 27, 2023
mloubout added a commit that referenced this issue Aug 2, 2023
mloubout added a commit that referenced this issue Aug 4, 2023
mloubout added a commit that referenced this issue Aug 8, 2023
mloubout added a commit that referenced this issue Aug 9, 2023
mloubout added a commit that referenced this issue Aug 23, 2023
mloubout added a commit that referenced this issue Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant