diff mbox series

[committed] amdgcn: Clean up device memory in gcn-run

Message ID 20240321130846.3808933-1-ams@baylibre.com
State New
Headers show
Series [committed] amdgcn: Clean up device memory in gcn-run | expand

Commit Message

Andrew Stubbs March 21, 2024, 1:08 p.m. UTC
There are some stability issues in the ROC runtime or drivers when we
run too many tests in quick succession.  I was hoping this patch might
fix it, but no; still good to fix the omissions though.

Committed to mainline.

gcc/ChangeLog:

	* config/gcn/gcn-run.cc (main): Add an hsa_memory_free calls for each
	device_malloc call.
---
 gcc/config/gcn/gcn-run.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/config/gcn/gcn-run.cc b/gcc/config/gcn/gcn-run.cc
index d45ff3e6c2ba..2f3ed2d41d2f 100644
--- a/gcc/config/gcn/gcn-run.cc
+++ b/gcc/config/gcn/gcn-run.cc
@@ -755,7 +755,13 @@  main (int argc, char *argv[])
 
   /* Clean shut down.  */
   XHSA (hsa_fns.hsa_memory_free_fn (kernargs),
-	"Clean up device memory");
+	"Clean up device kernargs memory");
+  XHSA (hsa_fns.hsa_memory_free_fn (args),
+	"Clean up device args memory");
+  XHSA (hsa_fns.hsa_memory_free_fn (heap),
+	"Clean up device heap memory");
+  XHSA (hsa_fns.hsa_memory_free_fn (stack),
+	"Clean up device stack memory");
   XHSA (hsa_fns.hsa_executable_destroy_fn (executable),
 	"Clean up GCN executable");
   XHSA (hsa_fns.hsa_queue_destroy_fn (queue),