public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/100573] New: [OpenMP] 'omp target teams' fails with nvptx and GCN offloading: FAIL libgomp.c-c++-common/for-3.c + for-9.c
@ 2021-05-12 19:54 burnus at gcc dot gnu.org
  2021-05-12 22:08 ` [Bug libgomp/100573] " burnus at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-05-12 19:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100573

            Bug ID: 100573
           Summary: [OpenMP] 'omp target teams' fails with nvptx and GCN
                    offloading: FAIL libgomp.c-c++-common/for-3.c +
                    for-9.c
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: openmp, wrong-code
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

The testcase
  libgomp.c-c++-common/for-9.c
is a thin wrapper around libgomp.c-c++-common/for-3.c with slightly different
settings. Hence, it is affected as well.

libgomp.c-c++-common/for-3.c has:

  int err = 0;
  #pragma omp target teams reduction(|:err)
    {
       err |= test_d_normal ();
...
    }
  if (err)
    abort ();

This will currently never fail because 'err' is mapped as firstprivate to the
target – at least until PR99928 is fixed (→ patch there).

Alternatively, manually adding a 'map(tofrom: err)' also works.

However, with that 'map added or the PR99928 patch applied:
* it still PASSES on x86-64-gnu-linux (-m64, -m32) with HOST FALLBACK
* BUT it FAILS both with AMD GCN and with NVPTX offloading.

But even without reduction and by checking each of the twenty-odd testcase
separately, it FAILS. Namely, I used the following:

  int err = 0, i = 1;

  #pragma omp target teams map(tofrom: err)
    { 
      err = test_d_normal ();
    }
  __builtin_printf("%d -> %d\n", i++, err);
  err = 0;

And the result is '-> 1' for all of them.

However, when I use 'omp target' instead of 'target teams', it passes.

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

end of thread, other threads:[~2021-05-26  9:28 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 19:54 [Bug libgomp/100573] New: [OpenMP] 'omp target teams' fails with nvptx and GCN offloading: FAIL libgomp.c-c++-common/for-3.c + for-9.c burnus at gcc dot gnu.org
2021-05-12 22:08 ` [Bug libgomp/100573] " burnus at gcc dot gnu.org
2021-05-18  8:00 ` vries at gcc dot gnu.org
2021-05-18  8:48 ` vries at gcc dot gnu.org
2021-05-18  9:09 ` jakub at gcc dot gnu.org
2021-05-18  9:18 ` jakub at gcc dot gnu.org
2021-05-24 18:22 ` burnus at gcc dot gnu.org
2021-05-24 18:39 ` jakub at gcc dot gnu.org
2021-05-25 14:39 ` jakub at gcc dot gnu.org
2021-05-25 15:55 ` burnus at gcc dot gnu.org
2021-05-25 16:02 ` jakub at gcc dot gnu.org
2021-05-25 18:03 ` jakub at gcc dot gnu.org
2021-05-25 18:28 ` jakub at gcc dot gnu.org
2021-05-25 19:34 ` burnus at gcc dot gnu.org
2021-05-25 19:38 ` amonakov at gcc dot gnu.org
2021-05-25 19:39 ` jakub at gcc dot gnu.org
2021-05-25 19:44 ` jakub at gcc dot gnu.org
2021-05-25 20:06 ` amonakov at gcc dot gnu.org
2021-05-25 20:12 ` burnus at gcc dot gnu.org
2021-05-25 20:20 ` amonakov at gcc dot gnu.org
2021-05-25 21:59 ` jakub at gcc dot gnu.org
2021-05-26  9:28 ` cvs-commit at gcc dot gnu.org

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).