]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp: enable reverse offload for AMDGCN
authorTobias Burnus <tobias@codesourcery.com>
Tue, 7 Feb 2023 08:58:46 +0000 (09:58 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Tue, 7 Feb 2023 08:58:46 +0000 (09:58 +0100)
libgomp/ChangeLog:

* libgomp.texi (5.0 Impl. Status, gcn specifics): Update for
reverse offload.
* plugin/plugin-gcn.c (GOMP_OFFLOAD_get_num_devices): Accept
reverse-offload requirement.

(cherry picked from commit f84fdb134dec02f68fd9a39a58e726023470e537)

libgomp/ChangeLog.omp
libgomp/libgomp.texi
libgomp/plugin/plugin-gcn.c

index 2012eabb5d14393f746af16aff9ea5ad2900071d..595792316caf328d5d91021f3c1755168abfab07 100644 (file)
@@ -1,4 +1,14 @@
-2023-02-02  Tobias Burnus  <tobias@codesourcery.com>
+2023-02-07  Tobias Burnus  <tobias@codesourcery.com>
+
+       Backported from master:
+       2023-02-03  Tobias Burnus  <tobias@codesourcery.com>
+
+       * libgomp.texi (5.0 Impl. Status, gcn specifics): Update for
+       reverse offload.
+       * plugin/plugin-gcn.c (GOMP_OFFLOAD_get_num_devices): Accept
+       reverse-offload requirement.
+
+2023-02-07  Tobias Burnus  <tobias@codesourcery.com>
 
        Backported from master:
        2023-02-02  Tobias Burnus  <tobias@codesourcery.com>
index b6d004e59b3d49d8910996232d1d4f74ff071252..1ac7646dbcb3a08312aa7346b3c2ad991b5bbb6f 100644 (file)
@@ -227,8 +227,7 @@ The OpenMP 4.5 specification is fully supported.
 @item @code{allocate} directive @tab N @tab
 @item @code{allocate} clause @tab P @tab Initial support
 @item @code{use_device_addr} clause on @code{target data} @tab Y @tab
-@item @code{ancestor} modifier on @code{device} clause
-      @tab Y @tab Host fallback with GCN devices
+@item @code{ancestor} modifier on @code{device} clause @tab Y @tab
 @item Implicit declare target directive @tab Y @tab
 @item Discontiguous array section with @code{target update} construct
       @tab N @tab
@@ -4450,9 +4449,13 @@ The implementation remark:
 @item I/O within OpenMP target regions and OpenACC compute regions is supported
       using the C library @code{printf} functions and the Fortran
       @code{print}/@code{write} statements.
-@item OpenMP code that has a requires directive with @code{unified_address},
-      @code{unified_shared_memory} or @code{reverse_offload} will remove
-      any GCN device from the list of available devices (``host fallback'').
+@item Reverse offload (i.e. @code{target} regions with
+      @code{device(ancestor:1)}) are processed serially per @code{target} region
+      such that the next reverse offload region is only executed after the previous
+      one returned.
+@item OpenMP code that has a requires directive with @code{unified_address} or
+      @code{unified_shared_memory} will remove any GCN device from the list of
+      available devices (``host fallback'').
 @end itemize
 
 
index 0e22aec87cb4dd25223b206ecc6cc9e6a04b013d..70a555a24a22d39d1c06bcb9d47286c323633a78 100644 (file)
@@ -3395,7 +3395,8 @@ GOMP_OFFLOAD_get_num_devices (unsigned int omp_requires_mask)
   /* Return -1 if no omp_requires_mask cannot be fulfilled but
      devices were present.  */
   if (hsa_context.agent_count > 0
-      && (omp_requires_mask & ~(GOMP_REQUIRES_UNIFIED_ADDRESS
+      && (omp_requires_mask & ~(GOMP_REQUIRES_REVERSE_OFFLOAD
+                               | GOMP_REQUIRES_UNIFIED_ADDRESS
                                | GOMP_REQUIRES_UNIFIED_SHARED_MEMORY)))
     return -1;
   return hsa_context.agent_count;