This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4] Questions about "declare target" and "target update" pragmas
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 28 Jan 2014 22:38:55 +0100
- Subject: Re: [gomp4] Questions about "declare target" and "target update" pragmas
- Authentication-results: sourceware.org; auth=none
- References: <20140122155151 dot GA50489 at msticlxl57 dot ims dot intel dot com> <20140122160209 dot GV892 at tucnak dot redhat dot com> <CADG=Z0HfieHLep+CQCxdyVe5_bSHT6K08YW+qGwvds5c8tBOyA at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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