This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [1/2] OpenACC routine support
- From: Cesar Philippidis <cesar at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Nathan Sidwell <nathan at acm dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 10 Nov 2015 06:37:27 -0800
- Subject: Re: [1/2] OpenACC routine support
- Authentication-results: sourceware.org; auth=none
- References: <5637B1CF dot 5060408 at acm dot org> <5637B7C7 dot 70901 at acm dot org> <20151103153533 dot GQ478 at tucnak dot redhat dot com> <56413AF1 dot 8070101 at acm dot org> <5641808F dot 10302 at codesourcery dot com> <20151110081603 dot GV5675 at tucnak dot redhat dot com>
On 11/10/2015 12:16 AM, Jakub Jelinek wrote:
> On Mon, Nov 09, 2015 at 09:28:47PM -0800, Cesar Philippidis wrote:
>> Here's the patch that Nathan was referring to. I ended up introducing a
>> boolean variable named first in the various functions which call
>> finalize_oacc_routines. The problem the original approach was having was
>> that the routine clauses is only applied to the first function
>> declarator in a declaration list. By using 'first', which is set to true
>> if the current declarator is the first in a sequence of declarators, I
>> was able to defer setting parser->oacc_routine to NULL.
>
> The #pragma omp declare simd has identical restrictions, but doesn't need
> to add any of the first parameters to the C++ parser.
> So, what are you doing differently that you need it? Handling both
> differently is a consistency issue, and unnecessary additional complexity to
> the parser.
I see that you added an omp_declare_simd->fndecl_seen field to
cp_parser. My objective was to try and make the c++ routine parsing
somewhat consistent with the c front end. I could probably add a similar
oacc_routine field, but I wonder if it would be better to share
omp_declare_simd. There was talk about the next version of openacc
adding support for -fopenacc and -fopenmp together. So maybe there needs
to be a separate oacc_routine field.
Cesar