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: Ilya Verbin <iverbin at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Mon, 16 Mar 2015 21:41:53 +0300
- 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> <20150310165252 dot GC37666 at msticlxl57 dot ims dot intel dot com>
On Tue, Mar 10, 2015 at 19:52:52 +0300, Ilya Verbin wrote:
> Hi Jakub,
>
> I have one more question :)
> This testcase seems to be correct... or not?
>
> #pragma omp declare target
> extern int G;
> #pragma omp end declare target
>
> int G;
>
> int main ()
> {
> #pragma omp target update to(G)
>
> return 0;
> }
>
> If yes, then we have a problem that the decl of G in varpool_node::get_create
> doesn't have "omp declare target" attribute.
Ping?
I am investigating run-fails on some benchmark, and have found a second
questionable place, where a function argument overrides a global array.
Just to be sure, is this a bug in the test?
#pragma omp declare target
int a1[50], a2[50];
#pragma omp end declare target
void foo (int a1[])
{
#pragma omp target
{
a1[10]++;
a2[10]++;
}
}
int main ()
{
a1[10] = a2[10] = 10;
#pragma omp target update to(a1, a2)
foo (a1);
#pragma omp target update from(a1, a2)
if (a1[10] != a2[10])
abort ();
return 0;
}
Thanks,
-- Ilya