public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [gomp4] Questions about "declare target" and "target update" pragmas
@ 2014-01-22 16:02 Ilya Verbin
  2014-01-22 18:02 ` Jakub Jelinek
  2015-03-10 16:53 ` Ilya Verbin
  0 siblings, 2 replies; 13+ messages in thread
From: Ilya Verbin @ 2014-01-22 16:02 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-03-19 19:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-22 16:02 [gomp4] Questions about "declare target" and "target update" pragmas Ilya Verbin
2014-01-22 18:02 ` Jakub Jelinek
2014-01-28 18:14   ` Ilya Verbin
2014-01-28 21:39     ` Jakub Jelinek
     [not found]       ` <CADG=Z0GzEZw8a8S_M+3SzEXKn++qf5UDRjcnWD5FdPNjN7u0Mw@mail.gmail.com>
2014-01-30 19:17         ` Fwd: " Ilya Verbin
2014-07-08 18:31       ` Ilya Verbin
2015-03-10 16:53 ` Ilya Verbin
2015-03-16 18:42   ` Ilya Verbin
2015-03-19 13:47     ` Jakub Jelinek
2015-03-19 14:50       ` Ilya Verbin
2015-03-19 14:57         ` Jakub Jelinek
2015-03-19 18:43           ` Ilya Verbin
2015-03-19 19:00             ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).