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: prevent multisubdimension expressions duplicates #2230

Merged
merged 1 commit into from
Oct 12, 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
8 changes: 8 additions & 0 deletions devito/passes/clusters/implicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from devito.ir import (Cluster, Interval, IntervalGroup, IterationSpace, Queue,
FetchUpdate, PrefetchUpdate, SEQUENTIAL)
from devito.symbolics import retrieve_dimensions
from devito.tools import as_tuple, timed_pass
from devito.types import Eq
from devito.types.grid import MultiSubDimension, SubDomainSet
Expand Down Expand Up @@ -106,6 +107,13 @@ def callback(self, clusters, prefix):
# The "implicit expressions" created for the MultiSubDomain
exprs, dims, sub_iterators = make_implicit_exprs(d.msd, c)

# Make sure the "implicit expressions" aren't scheduled in
# an inner loop. E.g schedule both for `t, xi, yi` and `t, d, xi, yi`
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you mean by "both" here?
I think the example could be a bit more clear here
OK in another PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For clusters with itspace t, xi, yi and t, d, xi, yi then this statement will be reached twice during the self.process once for t as a prefix and once for t, d

edims = set(retrieve_dimensions(exprs, deep=True))
if dim not in edims and any(d.dim in edims for d in prefix):
processed.append(c)
continue

# The IterationSpace induced by the MultiSubDomain
if dims:
intervals = [Interval(i) for i in dims]
Expand Down
Loading