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
diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c
index 5c13a7e..c853f01 100644
--- a/libgomp/oacc-parallel.c
+++ b/libgomp/oacc-parallel.c
@@ -303,12 +303,8 @@
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);