Skip to content
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: 3 additions & 5 deletions devito/passes/clusters/asynchrony.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from sympy import true

from devito.ir import (Forward, GuardBoundNext, WaitLock, WithLock, SyncArray,
from devito.ir import (Forward, Backward, GuardBoundNext, WaitLock, WithLock, SyncArray,
PrefetchUpdate, ReleaseLock, Queue, normalize_syncs)
from devito.passes.clusters.utils import in_critical_region, is_memcpy
from devito.symbolics import IntDiv, uxreplace
Expand Down Expand Up @@ -237,10 +237,8 @@ def _actions_from_update_memcpy(c, d, clusters, actions, sregistry):
target = e.lhs.function

fetch = e.rhs.indices[d]
if direction is Forward:
findex = fetch + 1
else:
findex = fetch - 1
fshift = {Forward: 1, Backward: -1}.get(direction, 0)
findex = fetch + fshift if fetch.find(IntDiv) else fetch._subs(pd, pd + fshift)

# If fetching into e.g. `ub[t1]` we might need to prefetch into e.g. `ub[t0]`
tindex0 = e.lhs.indices[d]
Expand Down