[gcc/devel/omp/gcc-13] libgomp, nvptx: report USM supported

Kwok Yeung kcy@gcc.gnu.org
Fri May 19 16:47:30 GMT 2023


https://gcc.gnu.org/g:44c9ad04d666b2ec87c3f43ce830dc73684bb5bc

commit 44c9ad04d666b2ec87c3f43ce830dc73684bb5bc
Author: Andrew Stubbs <ams@codesourcery.com>
Date:   Tue Mar 29 13:48:04 2022 +0100

    libgomp, nvptx: report USM supported
    
    libgomp/ChangeLog:
    
            * plugin/plugin-nvptx.c (GOMP_OFFLOAD_supported_features): Allow
            GOMP_REQUIRES_UNIFIED_ADDRESS and GOMP_REQUIRES_UNIFIED_SHARED_MEMORY.

Diff:
---
 libgomp/ChangeLog.omp         |  5 +++++
 libgomp/plugin/plugin-nvptx.c | 11 +++++++++++
 2 files changed, 16 insertions(+)

diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index 7865b7d9b4a..24448e39080 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,3 +1,8 @@
+2022-03-29  Andrew Stubbs  <ams@codesourcery.com>
+
+	* plugin/plugin-nvptx.c (GOMP_OFFLOAD_supported_features): Allow
+	GOMP_REQUIRES_UNIFIED_ADDRESS and GOMP_REQUIRES_UNIFIED_SHARED_MEMORY.
+
 2022-03-11  Andrew Stubbs  <ams@codesourcery.com>
 
 	* config/linux/allocator.c (always_pinned_mode): New variable.
diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index 345b2e6e6de..45c15106ad5 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -1281,6 +1281,17 @@ GOMP_OFFLOAD_fini_device (int n)
   return true;
 }
 
+/* Indicate which GOMP_REQUIRES_* features are supported.  */
+
+bool
+GOMP_OFFLOAD_supported_features (unsigned int *mask)
+{
+  *mask &= ~(GOMP_REQUIRES_UNIFIED_ADDRESS
+	     | GOMP_REQUIRES_UNIFIED_SHARED_MEMORY);
+
+  return (*mask == 0);
+}
+
 /* Return the libgomp version number we're compatible with.  There is
    no requirement for cross-version compatibility.  */


More information about the Gcc-cvs mailing list