This is the mail archive of the gcc@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: [gomp4] Questions about "declare target" and "target update" pragmas


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


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