public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/103384] New: [OpenMP] declare variant with device={kind(nohost)} does not use GPU, kind(gpu) works
@ 2021-11-23 14:27 burnus at gcc dot gnu.org
  2021-11-23 14:59 ` [Bug middle-end/103384] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-11-23 14:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103384
           Summary: [OpenMP] declare variant with device={kind(nohost)}
                    does not use GPU, kind(gpu) works
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: openmp, wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Created attachment 51861
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51861&action=edit
Testcase, fails as is (if omp_get_num_devices() > 0) and '{kind(nohost)}' -
works when later is changed to "match(device={kind(gpu)})"

Observed with
https://github.com/SOLLVE/sollve_vv/blob/master/tests/5.0/declare_target/test_declare_target_device_type_nohost.c

For that testcase with nvptx offloading, with

  #pragma omp declare variant(target_function) match(device={kind(gpu)})

target_function() is called and the code is executed on the GPU
(value a[0] = 5 (host function 'update') + 1 (device function
'target_function') == 6).


However, using kind(nohost), i.e.

  #pragma omp declare variant(target_function) match(device={kind(nohost)})

will *not* execute 'target_function' (thus: a[0] == 10 = 2*5 (host function
'update').


Expected: both {kind(nohost)} and {kind(gpu)} are executed on the GPU.

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

end of thread, other threads:[~2022-05-10  8:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 14:27 [Bug middle-end/103384] New: [OpenMP] declare variant with device={kind(nohost)} does not use GPU, kind(gpu) works burnus at gcc dot gnu.org
2021-11-23 14:59 ` [Bug middle-end/103384] " jakub at gcc dot gnu.org
2021-11-24  9:35 ` cvs-commit at gcc dot gnu.org
2021-11-24 10:00 ` jakub at gcc dot gnu.org
2021-11-29  8:50 ` cvs-commit at gcc dot gnu.org
2022-05-10  8:22 ` 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).