diff options
author | Julian Brown <julian@codesourcery.com> | 2019-09-19 05:26:44 -0700 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2020-03-03 12:51:25 +0100 |
commit | ff39b8b9248bcd24bc30d64fae8085322564d8ff (patch) | |
tree | bf638322193abb28a428751a530093cd5c567676 | |
parent | f3b04b11e2ed4c4c48bf40834c38ac4d66c0d64a (diff) | |
download | gcc-ff39b8b9248bcd24bc30d64fae8085322564d8ff.zip gcc-ff39b8b9248bcd24bc30d64fae8085322564d8ff.tar.gz gcc-ff39b8b9248bcd24bc30d64fae8085322564d8ff.tar.bz2 |
[og9] Add 'ephemeral' parameter to GOMP_OFFLOAD_openacc_async_host2dev
libgomp/
* plugin/plugin-nvptx.c (GOMP_OFFLOAD_openacc_async_host2dev):
Add EPHEMERAL parameter, and FIXME function comment.
(cherry picked from openacc-gcc-9-branch commit
3e8fcd5d0dafe0a83ce51c30d908de0318d13672)
-rw-r--r-- | libgomp/ChangeLog.omp | 5 | ||||
-rw-r--r-- | libgomp/plugin/plugin-nvptx.c | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp index 943a9e4..7813760 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -1,3 +1,8 @@ +2019-09-19 Julian Brown <julian@codesourcery.com> + + * plugin/plugin-nvptx.c (GOMP_OFFLOAD_openacc_async_host2dev): + Add EPHEMERAL parameter, and FIXME function comment. + 2019-09-18 Tobias Burnus <tobias@codesourcery.com> * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Fix dg-warning diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index 4beb322..452415e 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -1868,9 +1868,20 @@ GOMP_OFFLOAD_dev2dev (int ord, void *dst, const void *src, size_t n) return true; } +/* FIXME: It is unknown whether the cuMemcpyHtoDAsync API call caches source + data before the asynchronous copy takes place. Either way there is a data + race associated with ignoring the EPHEMERAL parameter here -- either if it + is TRUE (because we are copying uncached data that may disappear before the + async copy takes place) or if it is FALSE (because the source data may be + cached/snapshotted here before it is modified by an earlier async operation, + so stale data gets copied to the target). + Neither problem has been observed in practice, so far. */ + bool GOMP_OFFLOAD_openacc_async_host2dev (int ord, void *dst, const void *src, - size_t n, struct goacc_asyncqueue *aq) + size_t n, + bool ephemeral __attribute__((unused)), + struct goacc_asyncqueue *aq) { if (!nvptx_attach_host_thread_to_device (ord) || !cuda_memcpy_sanity_check (src, dst, n)) |