From b135fba87b60fbce50b7af761d61e796b8ecc773 Mon Sep 17 00:00:00 2001 From: Emilien Bauer Date: Mon, 31 Jul 2023 16:48:19 +0100 Subject: [PATCH] Add copy-out and dealloc. --- devito/ir/ietxdsl/cluster_to_ssa.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/devito/ir/ietxdsl/cluster_to_ssa.py b/devito/ir/ietxdsl/cluster_to_ssa.py index 4117161b50f..94d9e2c81f0 100644 --- a/devito/ir/ietxdsl/cluster_to_ssa.py +++ b/devito/ir/ietxdsl/cluster_to_ssa.py @@ -492,9 +492,10 @@ def match_and_rewrite(self, op: iet_ssa.LoadSymbolic, rewriter: PatternRewriter, incast = builtin.UnrealizedConversionCastOp.get(arg, memref_type) copy = gpu.MemcpyOp(source=incast, destination=alloc) body.insert_ops_before([alloc, outcast, incast, copy], body.ops.first) - print(arg) - print(arg.uses) - print(parent) + + copy_out = gpu.MemcpyOp(source=alloc, destination=incast) + dealloc = gpu.DeallocOp(alloc) + body.insert_ops_before([copy_out, dealloc], body.ops.last) op.result.replace_by(args[symb_name])