This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[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
- Date: Wed, 22 Jan 2014 19:51:51 +0400
- Subject: [gomp4] Questions about "declare target" and "target update" pragmas
- Authentication-results: sourceware.org; auth=none
Hi Jakub,
I have 2 questions concerning OpenMP 4.0 specification.
1. Do I understand correctly that every "declare target" directive should be
closed with "end declare target"? E.g. in this example GCC marks both foo1 and
foo2 with "omp declare target" attribute:
#pragma omp declare target
int foo1 () { return 1; }
int foo2 () { return 2; }
/* EOF */
Shouldn't the frontend issue an error message that there is "declare target"
without corresponding "end declare target"?
2. Do I understand correctly that the "target update" directive can be used
outside the "target" or "target data" regions? E.g. this example should
print '2' (and it prints '2' while building with icc):
#pragma omp declare target
int G = 1;
#pragma omp end declare target
int main ()
{
G = 2;
#pragma omp target update to(G)
G = 3;
int x = 0;
#pragma omp target
{
x = G;
}
printf ("%d\n", x);
}
If it is acceptable, then GOMP_target_update should also map variables that
wasn't mapped.
Thanks,
-- Ilya