summaryrefslogtreecommitdiff
path: root/libgomp/oacc-parallel.c
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2019-12-20 01:20:19 +0000
committerJulian Brown <jules@gcc.gnu.org>2019-12-20 01:20:19 +0000
commit5bcd470bf0749e1f56d05dd43aa9584ff2e3a090 (patch)
tree0ee2ecab91ac2cde55242703052242660832f5c6 /libgomp/oacc-parallel.c
parent378da98fcc907d05002bcd3d6ff7951f0cf485e5 (diff)
downloadgcc-5bcd470bf0749e1f56d05dd43aa9584ff2e3a090.tar.gz
Use gomp_map_val for OpenACC host-to-device address translation
libgomp/ * libgomp.h (gomp_map_val): Add prototype. * oacc-parallel.c (GOACC_parallel_keyed): Use gomp_map_val instead of open-coding device-address calculation. * target.c (gomp_map_val): Make global. Use OFFSET_POINTER in non-present case. Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com> From-SVN: r279622
Diffstat (limited to 'libgomp/oacc-parallel.c')
-rw-r--r--libgomp/oacc-parallel.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c
index 5c13a7e4348..c853f01b27f 100644
--- a/libgomp/oacc-parallel.c
+++ b/libgomp/oacc-parallel.c
@@ -303,12 +303,8 @@ GOACC_parallel_keyed (int flags_m, void (*fn) (void *),
devaddrs = gomp_alloca (sizeof (void *) * mapnum);
for (i = 0; i < mapnum; i++)
- if (tgt->list[i].key != NULL)
- devaddrs[i] = (void *) (tgt->list[i].key->tgt->tgt_start
- + tgt->list[i].key->tgt_offset
- + tgt->list[i].offset);
- else
- devaddrs[i] = NULL;
+ devaddrs[i] = (void *) gomp_map_val (tgt, hostaddrs, i);
+
if (aq == NULL)
acc_dev->openacc.exec_func (tgt_fn, mapnum, hostaddrs, devaddrs, dims,
tgt);