This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libgomp, OpenACC] Add more map handling for enter/exit data directives
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Chung-Lin Tang <chunglin_tang at mentor dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Thomas Schwinge <thomas at codesourcery dot com>
- Date: Tue, 13 Jun 2017 18:00:25 +0200
- Subject: Re: [libgomp, OpenACC] Add more map handling for enter/exit data directives
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 43FA9C0467DB
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 43FA9C0467DB
- References: <8f8391b0-5d9a-19db-671f-81f16063da59@mentor.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Jun 13, 2017 at 06:48:18PM +0800, Chung-Lin Tang wrote:
> Hi Jakub,
> this patch has been posted before, but hasn't really been reviewed yet:
> https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01927.html
>
> This has been deployed on gomp-4_0-branch for a long time, and was re-tested
> on current trunk, test results okay.
I don't see sufficient information on what you want to change and why
and whether the changes are backwards compatible (say will a valid
OpenACC 2.0 program compiled by GCC 7 work against both libgomp from GCC 7
as well as one with this patch)?
Can you write a few paragraphs on it (doesn't have to be comments in the
source, mailing list is fine)?
> @@ -318,25 +337,24 @@ GOACC_enter_exit_data (int device, size_t mapnum,
> {
> unsigned char kind = kinds[i] & 0xff;
>
> - /* Scan for PSETs. */
> - int psets = find_pset (i, mapnum, kinds);
> + /* Scan for pointers and PSETs. */
> + int pointer = find_pointer (i, mapnum, kinds);
>
> - if (!psets)
> + if (!pointer)
> {
> switch (kind)
> {
> - case GOMP_MAP_POINTER:
> - gomp_acc_insert_pointer (1, &hostaddrs[i], &sizes[i],
> - &kinds[i]);
> + case GOMP_MAP_ALLOC:
> + acc_present_or_create (hostaddrs[i], sizes[i]);
> break;
> case GOMP_MAP_FORCE_ALLOC:
> acc_create (hostaddrs[i], sizes[i]);
> break;
> - case GOMP_MAP_FORCE_PRESENT:
> + case GOMP_MAP_TO:
> acc_present_or_copyin (hostaddrs[i], sizes[i]);
> break;
> case GOMP_MAP_FORCE_TO:
> - acc_present_or_copyin (hostaddrs[i], sizes[i]);
> + acc_copyin (hostaddrs[i], sizes[i]);
> break;
E.g. in this hunk you remove GOMP_MAP_POINTER and GOMP_MAP_FORCE_PRESENT
handling and significantly change GOMP_MAP_FORCE_TO. The first two will
now gomp_fatal, right? Can it ever appear in GOACC_enter_exit_data
calls?
> default:
> gomp_fatal (">>>> GOACC_enter_exit_data UNHANDLED kind 0x%.2x",
Jakub