diff mbox series

[7/8,og9] NVPTX GOMP_OFFLOAD_openacc_async_construct arg fix and gomp_print_* support

Message ID 3df3ea7e8163b9ec0c7227c70c6e1154bf95c24a.1564776081.git.julian@codesourcery.com
State New
Headers show
Series AMD GCN offloading support | expand

Commit Message

Julian Brown Aug. 2, 2019, 8:12 p.m. UTC
This patch introduces versions of the gomp_print_{string,integer,double}
low-level printing functions that work for NVPTX.

ChangeLog

2019-07-31  Julian Brown  <julian@codesourcery.com>

	libgomp/
	* config/nvptx/gomp_print.c (gomp_print_string, gomp_print_integer,
	gomp_print_double): New.
	* plugin/plugin-nvptx.c (GOMP_OFFLOAD_openacc_async_construct): Add
	dummy device parameter.
---
 libgomp/ChangeLog.openacc         |  7 +++++++
 libgomp/config/nvptx/gomp_print.c | 20 ++++++++++++++++++++
 libgomp/plugin/plugin-nvptx.c     |  2 +-
 3 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 libgomp/config/nvptx/gomp_print.c
diff mbox series

Patch

diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc
index c03f8714408..c850203e145 100644
--- a/libgomp/ChangeLog.openacc
+++ b/libgomp/ChangeLog.openacc
@@ -1,3 +1,10 @@ 
+2019-07-31  Julian Brown  <julian@codesourcery.com>
+
+	* config/nvptx/gomp_print.c (gomp_print_string, gomp_print_integer,
+	gomp_print_double): New.
+	* plugin/plugin-nvptx.c (GOMP_OFFLOAD_openacc_async_construct): Add
+	dummy device parameter.
+
 2019-07-31  Julian Brown  <julian@codesourcery.com>
 
 	* libgomp.map (GOMP_2.0.GOMP_4_BRANCH): Remove GOACC_parallel_keyed_v2.
diff --git a/libgomp/config/nvptx/gomp_print.c b/libgomp/config/nvptx/gomp_print.c
new file mode 100644
index 00000000000..811bdd6e9a9
--- /dev/null
+++ b/libgomp/config/nvptx/gomp_print.c
@@ -0,0 +1,20 @@ 
+#include <stdio.h>
+#include <stdint.h>
+
+void
+gomp_print_string (const char *msg, const char *value)
+{
+  printf ("%s%s\n", msg, value);
+}
+
+void
+gomp_print_integer (const char *msg, int64_t value)
+{
+  printf ("%s%ld\n", msg, value);
+}
+
+void
+gomp_print_double (const char *msg, double value)
+{
+  printf ("%s%f\n", msg, value);
+}
diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index 09567ce852c..4beb3222e8f 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -1732,7 +1732,7 @@  GOMP_OFFLOAD_openacc_cuda_set_stream (struct goacc_asyncqueue *aq, void *stream)
 }
 
 struct goacc_asyncqueue *
-GOMP_OFFLOAD_openacc_async_construct (void)
+GOMP_OFFLOAD_openacc_async_construct (int device __attribute__((unused)))
 {
   CUstream stream = NULL;
   CUDA_CALL_ERET (NULL, cuStreamCreate, &stream, CU_STREAM_DEFAULT);