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

Reply via email to