On Tue, Jan 28, 2014 at 09:54:09PM +0400, Ilya Verbin wrote:
> Yes, when G is global variable marked with 'declare target', everything works
> fine.  But this testcase crashes at runtime in GOMP_target_update:
> 
> int main ()
> {
>   int G = 2;
>   #pragma omp target update to(G)
>   G = 3;
>   int x = 0;
>   #pragma omp target
>     {
>       x = G;
>     }
>   printf ("%d\n", x);
> }
> 
> Is it right, that such usage of 'target update' is not allowed by omp
> specification?

Yes, this testcase is invalid.
"If the corresponding list item is not present in the device data
environment, the behavior is unspecified."
Perhaps we shouldn't crash but do nothing, or complain to stderr, as QoI.

        Jakub

Reply via email to