diff --git a/xdsl/transforms/csl_stencil_bufferize.py b/xdsl/transforms/csl_stencil_bufferize.py index 09209a77f8..f5b8b9afc3 100644 --- a/xdsl/transforms/csl_stencil_bufferize.py +++ b/xdsl/transforms/csl_stencil_bufferize.py @@ -415,9 +415,11 @@ def match_and_rewrite(self, op: csl_stencil.ApplyOp, rewriter: PatternRewriter, arg.type, len(op.done_exchange.block.args) ) arg_to_tensor = to_tensor_op(arg, writable=True) + + # set offset going from a buf with ghost cells to one without, assuming symmetric ghost cells on all sides symmetric_offsets = tuple( - (s - d) // 2 - for s, d in zip( + (src - dst) // 2 # symmetric offset + for src, dst in zip( arg_t.get_shape(), yld_arg.type.get_shape(), strict=True ) )