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 --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  <jul...@codesourcery.com>
+
+       * plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_async_host2dev): Enqueue
+       copy from src_copy not src.
+
 2019-09-10  Kwok Cheung Yeung  <k...@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;
 }
 
-- 
2.22.0

Reply via email to