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: Patch data dependencies across Jumps #2065

Merged
merged 1 commit into from
Feb 13, 2023
Merged
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
6 changes: 5 additions & 1 deletion devito/ir/support/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from cached_property import cached_property
from sympy import S
from sympy.tensor.indexed import IndexException

from devito.ir.support.space import Backward, IterationSpace
from devito.ir.support.utils import AccessMode
Expand Down Expand Up @@ -822,7 +823,10 @@ def __init__(self, exprs, rules=None):
f = a.function
indices = [i if d in e.ispace else S.Infinity
for i, d in zip(a, a.aindices)]
mock = f.indexify(indices)
try:
mock = f.indexify(indices)
except IndexException:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would make this fail? Bad indices?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just empty indices, trivial sympy exception when you attempt to create an Indexed w/o supplying indices 😬

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you add some related message or failing test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely not a message; probably a unit test...

However, creating an artificial case exciting this code path here w/o PRO will take O(hour) time, which I don't have, so given that this is a minuscule thing and that, after all, we do have a test exciting this in PRO, despite agreeing w/ you this ain't ideal, I suggest we proceed

continue
v = self.writes.setdefault(f, [])
v.extend([TimedAccess(mock, 'R', i, e.ispace),
TimedAccess(mock, 'W', i, e.ispace)])
Expand Down