On Wed, Nov 04, 2020 at 02:03:27AM +0800, Chung-Lin Tang wrote: > > Â Â Â Â libgomp/ > > Â Â Â Â * libgomp.h (enum gomp_map_vars_kind): Adjust enum values to be > > bit-flag > > Â Â Â Â usable. > > Â Â Â Â * oacc-mem.c (acc_map_data): Adjust gomp_map_vars argument flags to > > Â Â Â Â 'GOMP_MAP_VARS_OPENACC | GOMP_MAP_VARS_ENTER_DATA'. > > Â Â Â Â (goacc_enter_datum): Likewise for call to gomp_map_vars_async. > > Â Â Â Â (goacc_enter_data_internal): Likewise. > > > > Â Â Â Â * target.c (gomp_map_vars_internal): Change checks of > > GOMP_MAP_VARS_ENTER_DATA > > Â Â Â Â to use bit-and (&). Adjust use of gomp_attach_pointer for OpenMP > > cases. > > Â Â Â Â (gomp_exit_data): Add handling of GOMP_MAP_DETACH. > > Â Â Â Â (GOMP_target_enter_exit_data): Add handling of GOMP_MAP_ATTACH. > > Â Â Â Â * testsuite/libgomp.c-c++-common/ptr-attach-1.c: New testcase.
Ok, with two nits fixed. > @@ -572,7 +573,8 @@ goacc_enter_datum (void **hostaddrs, size_t *sizes, void > *kinds, int async) > > struct target_mem_desc *tgt > = gomp_map_vars_async (acc_dev, aq, mapnum, hostaddrs, NULL, sizes, > - kinds, true, GOMP_MAP_VARS_ENTER_DATA); > + kinds, true, > + GOMP_MAP_VARS_OPENACC | > GOMP_MAP_VARS_ENTER_DATA); This line is too long. > assert (tgt); > assert (tgt->list_count == 1); > n = tgt->list[0].key; > @@ -1202,7 +1204,7 @@ goacc_enter_data_internal (struct gomp_device_descr > *acc_dev, size_t mapnum, > struct target_mem_desc *tgt > = gomp_map_vars_async (acc_dev, aq, groupnum, &hostaddrs[i], NULL, > &sizes[i], &kinds[i], true, > - GOMP_MAP_VARS_ENTER_DATA); > + GOMP_MAP_VARS_OPENACC | > GOMP_MAP_VARS_ENTER_DATA); And this one too. Please wrap them. Jakub