public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: James Norris <jnorris@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: OpenACC declare directive updates
Date: Fri, 06 Nov 2015 19:45:00 -0000	[thread overview]
Message-ID: <563D0345.7010208@codesourcery.com> (raw)
In-Reply-To: <20151106193127.GI5675@tucnak.redhat.com>

Jakub,


On 11/06/2015 01:31 PM, Jakub Jelinek wrote:
> On Wed, Nov 04, 2015 at 06:32:00AM -0600, James Norris wrote:
>> +/* Node in the linked list used for storing !$oacc declare constructs.  */
>> +
>> +typedef struct gfc_oacc_declare
>> +{
>> +  struct gfc_oacc_declare *next;
>> +  bool module_var;
>> +  gfc_omp_clauses *clauses;
>> +  gfc_omp_clauses *return_clauses;
>> +}
>> +gfc_oacc_declare;
>> +
>> +#define gfc_get_oacc_declare() XCNEW (gfc_oacc_declare)
>> +
>> +
>>   /* Node in the linked list used for storing !$omp declare simd constructs.  */
>>   
>>   typedef struct gfc_omp_declare_simd
>> @@ -1644,7 +1668,7 @@ typedef struct gfc_namespace
>>     struct gfc_data *data, *old_data;
>>   
>>     /* !$ACC DECLARE clauses.  */
>> -  gfc_omp_clauses *oacc_declare_clauses;
>> +  struct gfc_oacc_declare *oacc_declare_clauses;
> This should be renamed now that it doesn't hold just clauses,
> perhaps just oacc_declare?  Also, no need to use struct keyword.

That's fine, I'll fix that.

>
>> @@ -2857,6 +2957,42 @@ oacc_compatible_clauses (gfc_omp_clauses *clauses, int list,
>>     return false;
>>   }
>>   
>> +/* Check if a variable appears in multiple clauses.  */
>> +
>> +static void
>> +resolve_omp_duplicate_list (gfc_omp_namelist *clause_list, bool openacc,
>> +			    int list)
>> +{
>> +  gfc_omp_namelist *n;
>> +  const char *error_msg = "Symbol %qs present on multiple clauses at %L";
>> +
>> +  /* OpenACC reduction clauses are compatible with everything.  We only
>> +     need to check if a reduction variable is used more than once.  */
>> +  if (openacc && list == OMP_LIST_REDUCTION)
>> +    {
>> +      hash_set<gfc_symbol *> reductions;
>> +
>> +      for (n = clause_list; n; n = n->next)
>> +	{
>> +	  if (reductions.contains (n->sym))
>> +	    gfc_error (error_msg, n->sym->name, &n->expr->where);
>> +	  else
>> +	    reductions.add (n->sym);
>> +	}
>> +
>> +      return;
>> +    }
>> +
>> +  /* Ensure that variables are only used in one clause.  */
>> +  for (n = clause_list; n; n = n->next)
>> +    {
>> +      if (n->sym->mark)
>> +	gfc_error (error_msg, n->sym->name, &n->expr->where);
>> +      else
>> +	n->sym->mark = 1;
>> +    }
>> +}
> You are readding a function that has been rejected, OMP_LIST_REDUCTION
> is handled differently now.
>
> 	Jakub

Okay, I'll fix this.

After fixing, OK to commit?

Thank you for taking the time for the review.

Jim



  reply	other threads:[~2015-11-06 19:45 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02 13:46 James Norris
2015-11-04 12:32 ` James Norris
2015-11-06 13:46   ` James Norris
2015-11-06 19:31   ` Jakub Jelinek
2015-11-06 19:45     ` James Norris [this message]
2015-11-06 19:49       ` Jakub Jelinek
2015-11-06 20:20         ` James Norris
2015-11-19 16:22         ` James Norris
2015-11-20 10:53           ` Jakub Jelinek
2015-11-27 11:41           ` [gomp4] " Thomas Schwinge
2019-06-18 23:02             ` [committed] [PR85221] Set 'omp declare target', 'omp declare target link' attributes for Fortran OpenACC 'declare'd variables (was: [gomp4] Re: OpenACC declare directive updates) Thomas Schwinge
2015-11-08 15:29       ` OpenACC declare directive updates James Norris
2015-11-09  2:30         ` Cesar Philippidis
2015-11-09  4:53           ` James Norris
2015-11-18 20:09             ` Cesar Philippidis
  -- strict thread matches above, loose matches on Subject: below --
2015-10-27 20:20 [OpenACC] declare directive James Norris
2015-10-28 16:33 ` Cesar Philippidis
2015-10-28 16:33   ` James Norris
2015-11-03 16:31 ` James Norris
2015-11-04 16:49   ` Thomas Schwinge
2015-11-04 17:12     ` James Norris
2015-11-06 16:08     ` James Norris
2015-11-06 16:16       ` James Norris
2015-11-06 19:04       ` Jakub Jelinek
2015-11-06 19:23         ` Jakub Jelinek
2015-11-06 20:18           ` James Norris
2015-11-06 20:28             ` Jakub Jelinek
2015-11-06 20:35               ` James Norris
2015-11-06 20:16         ` James Norris
2015-11-08 15:35         ` James Norris
2015-11-09 16:01           ` James Norris
2015-11-09 16:21             ` Jakub Jelinek
2015-11-09 16:31               ` James Norris
2015-11-09 23:11               ` James Norris
2015-11-11  8:32                 ` Jakub Jelinek
2015-11-11 10:08                   ` Thomas Schwinge
2015-11-11 17:29                     ` Jakub Jelinek
2015-11-12  1:08                   ` James Norris
2015-11-12  9:10                     ` Jakub Jelinek
2015-11-12 13:34                       ` James Norris
2015-11-23 12:41                         ` Thomas Schwinge
2015-11-24  8:45                           ` [gomp4] " Thomas Schwinge
2015-11-12 23:25                             ` [PATCH] Fix unused variable James Norris
2015-11-22 19:11                               ` [PATCH] fortran/openmp.c -- Fix bootstrap Steve Kargl
2015-11-22 19:27                                 ` Jerry DeLisle
2015-11-22 20:38                                 ` James Norris
2019-06-18 22:45                           ` [committed] Fix description of 'GOMP_MAP_FIRSTPRIVATE' (was: [OpenACC] declare directive) Thomas Schwinge
2019-06-18 22:21                     ` [committed] [PR90862] OpenACC 'declare' ICE when nested inside another construct " Thomas Schwinge
2015-11-06 13:48 ` [OpenACC] declare directive James Norris
2021-06-10 11:15 ` Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=563D0345.7010208@codesourcery.com \
    --to=jnorris@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).