Skip to content

Commit

Permalink
ir: Fix group_expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioLuporini committed Apr 12, 2018
1 parent 3dc0614 commit 5b23914
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions devito/ir/support/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,15 @@ def group_expressions(exprs):
# Partion based on data dependences
mapper = OrderedDict()
ngroups = 0
for i, e1 in enumerate(exprs):
for e1 in exprs:
if e1 in mapper:
# Optimization: we know already that a group for `e1` has been found
continue
found = False
for e2 in exprs[i+1:]:
if Scope([e1, e2]).has_dep:
for e2 in exprs:
if e1 is e2:
continue
elif Scope([e1, e2]).has_dep:
v = mapper.get(e1, mapper.get(e2))
if v is None:
ngroups += 1
Expand Down

0 comments on commit 5b23914

Please sign in to comment.