This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, libgomp, OpenACC] Additional enter/exit data map handling
- From: Chung-Lin Tang <chunglin_tang at mentor dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>, Chung-Lin Tang <cltang at codesourcery dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 8 Sep 2016 19:18:30 +0800
- Subject: Re: [patch, libgomp, OpenACC] Additional enter/exit data map handling
- Authentication-results: sourceware.org; auth=none
- References: <66f8ce3d-7206-ee8a-abaa-4bb25423e4eb@codesourcery.com> <87twdtfcsk.fsf@hertz.schwinge.homeip.net>
On 2016/9/6 8:11 PM, Thomas Schwinge wrote:
> Hi!
>
> On Mon, 29 Aug 2016 15:46:47 +0800, Chung-Lin Tang <cltang@codesourcery.com> wrote:
>> this patch is a port of some changes from gomp-4_0-branch,
>> including adding additional map type handling in OpenACC enter/exit data
>> directives, and some pointer set handling changes. Updated
>> testsuite case are also included.
>>
>> Tested on trunk to ensure no regressions, is this okay for trunk?
>
>> 2016-08-29 Cesar Philippidis <cesar@codesourcery.com>
>> Thomas Schwinge <thomas@codesourcery.com>
>> Chung-Lin Tang <cltang@codesourcery.com>
>
> Maybe I'm misremembering, but I can't remember having been involved in
> this. ;-)
A part of this was picked from r223178, which you committed to gomp-4_0-branch.
>> +/* Returns the number of mappings associated with the pointer or pset. PSET
>> + have three mappings, whereas pointer have two. */
>> +
>> static int
>> -find_pset (int pos, size_t mapnum, unsigned short *kinds)
>> +find_pointer (int pos, size_t mapnum, unsigned short *kinds)
>> {
>> if (pos + 1 >= mapnum)
>> return 0;
>>
>> unsigned char kind = kinds[pos+1] & 0xff;
>>
>> - return kind == GOMP_MAP_TO_PSET;
>> + if (kind == GOMP_MAP_TO_PSET)
>> + return 3;
>> + else if (kind == GOMP_MAP_POINTER)
>> + return 2;
>> +
>> + return 0;
>> }
>
> I'm still confused about that find_pset/find_pointer handling. Why is
> that required? Essentially, that means that GOACC_enter_exit_data is
> skipping over some mappings, right? If yes, why do the front ends
> (Fortran only?) then emit these mappings to begin with, if we're then
> ignoring them in the runtime?
It's not skipping mappings. GOMP_MAP_PSET uses 3 continuous entries while
GOMP_MAP_POINTER uses 2, see how these are eventually processed together
in gomp_map_vars().
Chung-Lin