public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/103384] New: [OpenMP] declare variant with device={kind(nohost)} does not use GPU, kind(gpu) works
Date: Tue, 23 Nov 2021 14:27:44 +0000	[thread overview]
Message-ID: <bug-103384-4@http.gcc.gnu.org/bugzilla/> (raw)

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.

             reply	other threads:[~2021-11-23 14:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 14:27 burnus at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103384-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).