diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2020-05-14 20:48:10 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2020-07-03 17:14:40 +0200 |
commit | e7f3f7fe08bdd49367f682398e1d2f4e6b60ef84 (patch) | |
tree | 7daeaf130d495ed2cbc91131729cf2ebb96b1472 /libgomp/oacc-mem.c | |
parent | 995aba5867b1c64b2b56a200ef16b135effe85f7 (diff) | |
download | gcc-e7f3f7fe08bdd49367f682398e1d2f4e6b60ef84.zip gcc-e7f3f7fe08bdd49367f682398e1d2f4e6b60ef84.tar.gz gcc-e7f3f7fe08bdd49367f682398e1d2f4e6b60ef84.tar.bz2 |
[OpenACC] Revert always-copyfrom behavior for 'GOMP_MAP_FORCE_FROM' in 'libgomp/oacc-mem.c:goacc_exit_data_internal'
As done for 'GOMP_MAP_FROM', also for 'GOMP_MAP_FORCE_FROM' we should only
'gomp_copy_dev2host' if 'n->refcount == 0'.
This had gotten altered in commit 378da98fcc907d05002bcd3d6ff7951f0cf485e5
(r279621) "OpenACC reference count overhaul".
libgomp/
* oacc-mem.c (goacc_exit_data_internal): Revert always-copyfrom
behavior for 'GOMP_MAP_FORCE_FROM'.
* testsuite/libgomp.oacc-c-c++-common/pr92843-1.c: Adjust XFAIL.
Diffstat (limited to 'libgomp/oacc-mem.c')
-rw-r--r-- | libgomp/oacc-mem.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c index 1a0cd4c..4fb78ee 100644 --- a/libgomp/oacc-mem.c +++ b/libgomp/oacc-mem.c @@ -1144,16 +1144,17 @@ goacc_exit_data_internal (struct gomp_device_descr *acc_dev, size_t mapnum, else if (n->refcount > 0 && n->refcount != REFCOUNT_INFINITY) n->refcount--; - if (copyfrom - && (kind != GOMP_MAP_FROM || n->refcount == 0)) - gomp_copy_dev2host (acc_dev, aq, (void *) cur_node.host_start, - (void *) (n->tgt->tgt_start + n->tgt_offset - + cur_node.host_start - - n->host_start), - cur_node.host_end - cur_node.host_start); - if (n->refcount == 0) { + if (copyfrom) + { + void *d = (void *) (n->tgt->tgt_start + n->tgt_offset + + cur_node.host_start - n->host_start); + gomp_copy_dev2host (acc_dev, aq, + (void *) cur_node.host_start, d, + cur_node.host_end - cur_node.host_start); + } + if (aq) /* TODO We can't do the 'is_tgt_unmapped' checking -- see the 'gomp_unref_tgt' comment in |