Skip to content

Commit

Permalink
Merge pull request #2211 from AndrewCheng827/Andrew_fix_2194
Browse files Browse the repository at this point in the history
compiler: Addressed comments on PR #2200
  • Loading branch information
georgebisbas authored Sep 20, 2023
2 parents 7dd5ef8 + 2655a34 commit 1ded3da
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions devito/ir/support/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,27 +429,15 @@ def distance(self, other):
if i.is_Number and j.is_Number:
return Vector(S.ImaginaryUnit)
else:
# If both i and j are not numbers,
# there may be dimension-dependent dependencies
# so we append the distance

# For example:
# Eq(u[0, y], 1)
# Eq(u[1, 1], u[0, y+1])
ret.append(S.Infinity)

# We are writing over an entire dimension
# but reading from one point.
# If there are overlaps between the two
# then we would have a dependency
# This is a conservative estimation as there are cases
# where we may or may not have a dependency
# given that we don't write
# depending on domain size, which is not compilation-time known
# self=W<u,[0,y]> and other=R<u,[0,y+1]>
ret.append(v)

# Writing (reading) over an entire dimension, reading (writing)
# from one point

# For example:
# Eq(u[0, y], 1)
# Eq(u[1, y+1], u[0, 1])
# self=R<u,[1,2]> and other=W<u,[1, y+1]>
elif (not i.is_Number or not j.is_Number):
ret.append(S.Infinity)

Expand Down

0 comments on commit 1ded3da

Please sign in to comment.