diff mbox series

[og9] Fix src_copy mismerge in GOMP_OFFLOAD_openacc_async_host2dev

Message ID 20190910174143.46888-1-julian@codesourcery.com
State New
Headers show
Series [og9] Fix src_copy mismerge in GOMP_OFFLOAD_openacc_async_host2dev | expand

Commit Message

Julian Brown Sept. 10, 2019, 5:41 p.m. UTC
This patch fixes a typo in the GOMP_OFFLOAD_openacc_async_host2dev
function that bypassed the temporary buffer used to hold source data
for asynchronous host-to-device copies.

Tested with offloading to AMD GCN. I will apply to the
openacc-gcc-9-branch shortly.

Thanks,

Julian

ChangeLog

	libgomp/
	* plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_async_host2dev): Enqueue
	copy from src_copy not src.
---
 libgomp/ChangeLog.openacc   | 5 +++++
 libgomp/plugin/plugin-gcn.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc
index 59605cd85bf..a15d4a0ed49 100644
--- a/libgomp/ChangeLog.openacc
+++ b/libgomp/ChangeLog.openacc
@@ -1,3 +1,8 @@ 
+2019-09-10  Julian Brown  <julian@codesourcery.com>
+
+	* plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_async_host2dev): Enqueue
+	copy from src_copy not src.
+
 2019-09-10  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
 	* config/gcn/team.c (gomp_gcn_exit_kernel): Free GCN thread list.
diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c
index 9d03e4f9f5b..2b17204cd80 100644
--- a/libgomp/plugin/plugin-gcn.c
+++ b/libgomp/plugin/plugin-gcn.c
@@ -3613,7 +3613,7 @@  GOMP_OFFLOAD_openacc_async_host2dev (int device, void *dst, const void *src,
      But, that is probably correct.  */
   void *src_copy = GOMP_PLUGIN_malloc (n);
   memcpy (src_copy, src, n);
-  queue_push_copy (aq, dst, src, n, true);
+  queue_push_copy (aq, dst, src_copy, n, true);
   return true;
 }