[PATCH 07/13] OpenACC 2.6 deep copy: libgomp parts

Thomas Schwinge thomas@codesourcery.com
Tue Jun 30 15:58:52 GMT 2020


Hi Julian!

On 2019-12-17T22:03:47-0800, Julian Brown <julian@codesourcery.com> wrote:
> This part contains the libgomp runtime support for the GOMP_MAP_ATTACH and
> GOMP_MAP_DETACH mapping kinds (etc.), as introduced by the front-end
> patches following in this series.

> --- a/libgomp/target.c
> +++ b/libgomp/target.c
> @@ -540,6 +540,7 @@ gomp_map_vars_existing (struct gomp_device_descr *devicep,
>    tgt_var->key = oldn;
>    tgt_var->copy_from = GOMP_MAP_COPY_FROM_P (kind);
>    tgt_var->always_copy_from = GOMP_MAP_ALWAYS_FROM_P (kind);
> +  tgt_var->do_detach = kind == GOMP_MAP_ATTACH;
>    tgt_var->offset = newn->host_start - oldn->host_start;
>    tgt_var->length = newn->host_end - newn->host_start;
>

For 'kind == GOMP_MAP_ATTACH', this function 'gomp_map_vars_existing' is
actually unreachable.

> @@ -978,8 +979,15 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep,
>         has_firstprivate = true;
>         continue;
>       }
> +      else if ((kind & typemask) == GOMP_MAP_ATTACH)
> +     {
> +       tgt->list[i].key = NULL;
> +       has_firstprivate = true;
> +       continue;
> +     }

Given this, the following condition also is always-false:

>        cur_node.host_start = (uintptr_t) hostaddrs[i];
> -      if (!GOMP_MAP_POINTER_P (kind & typemask))
> +      if (!GOMP_MAP_POINTER_P (kind & typemask)
> +       && (kind & typemask) != GOMP_MAP_ATTACH)
>       cur_node.host_end = cur_node.host_start + sizes[i];
>        else
>       cur_node.host_end = cur_node.host_start + sizeof (void *);

Thus pushed "Mark up unreachable OpenACC 'attach' code path" to master
branch in commit aff43ac0aed5185884724adbdfd4dbbabd87637c, and
releases/gcc-10 branch in commit
4b185ee144d0c53ea7f08d4edaa8b578739498be, see attached.


Grüße
 Thomas


-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Mark-up-unreachable-OpenACC-attach-code-path.patch
Type: text/x-diff
Size: 1686 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20200630/d742bf53/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Mark-up-unreachable-OpenACC-attach-code-path.g10.patch
Type: text/x-diff
Size: 1756 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20200630/d742bf53/attachment-0001.bin>


More information about the Fortran mailing list