public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] amdgcn: Clean up device memory in gcn-run
@ 2024-03-21 13:08 Andrew Stubbs
  0 siblings, 0 replies; only message in thread
From: Andrew Stubbs @ 2024-03-21 13:08 UTC (permalink / raw)
  To: gcc-patches

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 --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),
-- 
2.41.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-21 13:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-21 13:08 [committed] amdgcn: Clean up device memory in gcn-run Andrew Stubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).