On Thu, May 29, 2014 at 12:14:45AM +0200, Jakub Jelinek wrote:
> > +#pragma omp target update from(a, b, b) /* { dg-error "'b' appears more 
> > than once in motion clauses" } */
> > +#pragma omp target update to(a) to(b, b) /* { dg-error "'b' appears more 
> > than once in motion clauses" } */
> > +#pragma omp target update from(a, b) from(b) /* { dg-error "'b' appears 
> > more than once in motion clauses" } */
> > +#pragma omp target update from(a) to(b) from(b) /* { dg-error "'b' appears 
> > more than once in motion clauses" } */
> > +#pragma omp target update from(a) to(b) to(b) /* { dg-error "'b' appears 
> > more than once in motion clauses" } */
> > +
> > +#pragma omp target update to(a) from(a[1:1]) /* { dg-error "'a' appears 
> > more than once in motion clauses" "not implemented" { xfail *-*-* } } */
> 
> Here I guess it really depends if a and a[1:1] is the same list item, I'd
> say they are not.  I think it should be fine and useful to use at least
> the cases where there is the same underlying variable, but non-overlapping
> sections like:
> #pragma omp target update to(a[10:4]) from(a[0:5])

Also, if you have say:
int *a;
void
foo ()
{
  #pragma omp target update to (a) from (a[0:10])
}
then there is actually no overlap, this would write the host
pointer value to the device's a pointer copy, and copy 40 bytes
from the device back to where a points.

        Jakub

Reply via email to