]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Miscellaneous clean-up re OpenMP 'ompx_host_mem_space'
authorThomas Schwinge <thomas@codesourcery.com>
Fri, 17 Feb 2023 13:13:15 +0000 (14:13 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 24 Mar 2023 16:26:18 +0000 (17:26 +0100)
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'.

libgomp/ChangeLog.omp
libgomp/config/gcn/allocator.c

index 63d1f563d5d45e16d9126c105df0e7dbc049b9f9..ef957e3d2d8d913878fe43cd364dedc010cdfdf7 100644 (file)
@@ -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>
 
index 001de89ffe056a863c376aa9dd1bd01a4087c395..e9980f6f98e18e887b1e400f0779bcb2e87d681e 100644 (file)
@@ -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);
 }