From: Andrew Stubbs <ams@baylibre.com>
To: gcc-patches@gcc.gnu.org
Subject: [committed] amdgcn: Clean up device memory in gcn-run
Date: Thu, 21 Mar 2024 13:08:46 +0000 [thread overview]
Message-ID: <20240321130846.3808933-1-ams@baylibre.com> (raw)
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
reply other threads:[~2024-03-21 13:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240321130846.3808933-1-ams@baylibre.com \
--to=ams@baylibre.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).