public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-12] Miscellaneous clean-up re OpenMP 'ompx_host_mem_space'
@ 2023-03-24 16:28 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-03-24 16:28 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b39e4bbab59f5e4b551c44dbce0ce3acf4afc22a

commit b39e4bbab59f5e4b551c44dbce0ce3acf4afc22a
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Fri Feb 17 14:13:15 2023 +0100

    Miscellaneous clean-up re OpenMP 'ompx_host_mem_space'
    
    Like done for nvptx in og12 commit 23f52e49368d7b26a1b1a72d6bb903d31666e961
    "Miscellaneous clean-up re OpenMP 'ompx_unified_shared_mem_space', 'ompx_host_mem_space'".
    
    Clean-up for og12 commit c77c45a641fedc3fe770e909cc010fb1735bdbbd
    "amdgcn, libgomp: low-latency allocator".  No functional change.
    
            libgomp/
            * config/gcn/allocator.c (gcn_memspace_free): Explicitly handle
            'memspace == ompx_host_mem_space'.

Diff:
---
 libgomp/ChangeLog.omp          | 3 +++
 libgomp/config/gcn/allocator.c | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index 63d1f563d5d..ef957e3d2d8 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,5 +1,8 @@
 2023-03-24  Thomas Schwinge  <thomas@codesourcery.com>
 
+	* config/gcn/allocator.c (gcn_memspace_free): Explicitly handle
+	'memspace == ompx_host_mem_space'.
+
 	Backported from master:
 	2023-03-24  Thomas Schwinge  <thomas@codesourcery.com>
 
diff --git a/libgomp/config/gcn/allocator.c b/libgomp/config/gcn/allocator.c
index 001de89ffe0..e9980f6f98e 100644
--- a/libgomp/config/gcn/allocator.c
+++ b/libgomp/config/gcn/allocator.c
@@ -36,6 +36,7 @@
    when the memspace access trait is set accordingly.  */
 
 #include "libgomp.h"
+#include <assert.h>
 #include <stdlib.h>
 
 #define BASIC_ALLOC_PREFIX __gcn_lowlat
@@ -86,6 +87,9 @@ gcn_memspace_free (omp_memspace_handle_t memspace, void *addr, size_t size)
 
       __gcn_lowlat_free (shared_pool, addr, size);
     }
+  else if (memspace == ompx_host_mem_space)
+    /* Just verify what all allocator functions return.  */
+    assert (addr == NULL);
   else
     free (addr);
 }

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

only message in thread, other threads:[~2023-03-24 16:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 16:28 [gcc/devel/omp/gcc-12] Miscellaneous clean-up re OpenMP 'ompx_host_mem_space' Thomas Schwinge

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).