+2019-12-19 Julian Brown <julian@codesourcery.com>
+ Cesar Philippidis <cesar@codesourcery.com>
+
+ * 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.
+
2019-12-19 Julian Brown <julian@codesourcery.com>
* libgomp.h (struct splay_tree_key_s): Substitute dynamic_refcount
extern void gomp_copy_dev2host (struct gomp_device_descr *,
struct goacc_asyncqueue *, void *, const void *,
size_t);
+extern uintptr_t gomp_map_val (struct target_mem_desc *, void **, size_t);
extern struct target_mem_desc *gomp_map_vars (struct gomp_device_descr *,
size_t, void **, 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);
(void *) cur_node.host_end);
}
-static inline uintptr_t
+attribute_hidden uintptr_t
gomp_map_val (struct target_mem_desc *tgt, void **hostaddrs, size_t i)
{
if (tgt->list[i].key != NULL)
{
/* Not present, hence, skip entry - including its MAP_POINTER,
when existing. */
- tgt->list[i].offset = 0;
+ tgt->list[i].offset = OFFSET_POINTER;
if (i + 1 < mapnum
&& ((typemask & get_kind (short_mapkind, kinds, i + 1))
== GOMP_MAP_POINTER))