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

misc: Replace dimension check in pull_dims #2275

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Changes from 1 commit
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
12 changes: 2 additions & 10 deletions devito/passes/iet/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,10 @@ def remove_redundant_moddims(iet):


def abridge_dim_names(iet):
trees = retrieve_iteration_tree(iet)

mapper = {}
# Build a mapper replacing SubDimension names with respective root dimension
# names where possible
for tree in trees:
for tree in retrieve_iteration_tree(iet):
# Find SubDimensions or SubDimension-derived dimensions used as indices in
# the expression in the innermost loop
indexeds = FindSymbols('indexeds').visit(tree.inner)
Expand Down Expand Up @@ -243,10 +241,4 @@ def abridge_dim_names(iet):
if not mapper: # No SubDimensions to be renamed
return iet

subs = {}
for tree in trees:
subs.update({i: Uxreplace(mapper).visit(i) for i in tree})

iet = Transformer(subs, nested=True).visit(iet)

return iet
return Uxreplace(mapper, nested=True).visit(iet)
Loading