public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Cesar Philippidis <cesar@codesourcery.com>
Cc: Thomas Schwinge <thomas@codesourcery.com>,
	       "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [patch,openacc] use firstprivate pointers for subarrays in c and c++
Date: Wed, 01 Jun 2016 17:52:00 -0000	[thread overview]
Message-ID: <20160601175247.GV28550@tucnak.redhat.com> (raw)
In-Reply-To: <574F1C6C.5020704@codesourcery.com>

On Wed, Jun 01, 2016 at 10:33:32AM -0700, Cesar Philippidis wrote:
> >>  	switch (OMP_CLAUSE_MAP_KIND (c))
> >>  	  {
> >>  	  case GOMP_MAP_ALLOC:
> > | 	  case GOMP_MAP_TO:
> > | 	  case GOMP_MAP_FROM:
> > | 	  case GOMP_MAP_TOFROM:
> > | 	  case GOMP_MAP_ALWAYS_TO:
> > | 	  case GOMP_MAP_ALWAYS_FROM:
> > | 	  case GOMP_MAP_ALWAYS_TOFROM:
> > | 	  case GOMP_MAP_RELEASE:
> > | 	  case GOMP_MAP_DELETE:
> > | 	    OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION (c) = 1;
> > | 	    break;
> > | 	  default:
> >>  	    break;
> >>  	  }
> > 
> > Why doesn't that apply also to the other (OpenACC) map kinds?  Comparing
> > to the full list in include/gomp-constants.h:enum gomp_map_kind, there
> > are several missing here.
> 
> It does look like there are situations where OpenACC can take
> zero-length arrays, e.g. when the length argument is a variable. This
> will be fixed in my follow up patch.

The question is if you need/want the OpenMP 4.5 mandated handling of zero length
array sections for those, where mapping of zero length array section (unlike
e.g. GNU extension zero length object) doesn't actually map it if not
already mapped, but sets the corresponding pointer to NULL.  If already
mapped, it increments refcount. 

> >> @@ -6054,7 +6070,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
> >>  	    omp_note_field_privatization (t, OMP_CLAUSE_DECL (c));
> >>  	  else
> >>  	    t = OMP_CLAUSE_DECL (c);
> >> -	  if (t == current_class_ptr)
> >> +	  if (ort != C_ORT_ACC && t == current_class_ptr)
> >>  	    {
> >>  	      error ("%<this%> allowed in OpenMP only in %<declare simd%>"
> >>  		     " clauses");
> > 
> > ;-) Hmm, reminds me of the unresolved task to support the C++ "this"
> > pointer in OpenACC...  Anyway, in GCC trunk, we're not allowing "this"
> > usage, I think, so I suppose this should stay as-is?  (Possibly with an
> > OpenACC-specific error message.)
> 
> What do you want to do about c++'s 'this' in OpenACC? It looks like
> gomp4 partially supports it. Maybe we should wait to get clarification
> from the technical committee?

In OpenMP 4.5 it is only allowed in declare simd clauses, but that might
change in OpenMP 5.0.

	Jakub

      reply	other threads:[~2016-06-01 17:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 20:30 Cesar Philippidis
2016-05-19 22:35 ` [ping][patch,openacc] " Cesar Philippidis
2016-05-20  9:42 ` [patch,openacc] " Jakub Jelinek
2016-05-24  2:32   ` Cesar Philippidis
2016-05-24  6:10     ` Jakub Jelinek
2016-05-24 21:49       ` Cesar Philippidis
2016-05-24 21:55         ` Jakub Jelinek
2016-05-25 19:04           ` Thomas Schwinge
2016-06-01 17:33             ` Cesar Philippidis
2016-06-01 17:52               ` Jakub Jelinek [this message]

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=20160601175247.GV28550@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=cesar@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=thomas@codesourcery.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).