This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch,openacc] use firstprivate pointers for subarrays in c and c++


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]