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/105662] New: [RFC][OpenMP][OpenMP] - permit disabling host-fallback mode?
Date: Thu, 19 May 2022 15:13:30 +0000	[thread overview]
Message-ID: <bug-105662-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 105662
           Summary: [RFC][OpenMP][OpenMP] - permit disabling host-fallback
                    mode?
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: openacc, openmp
          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, tschwinge at gcc dot gnu.org
  Target Milestone: ---

The following issue came up / was mentioned elsewhere:

   It can be useful do disable host fallback
   and generate only device/nonhost versions
   for (OpenMP) target / (OpenACC) compute regions.

Some other closed-source compilers have this feature and Clang recently got
that
feature.

Some users seem to interested in this to avoid creating separate functions –
and
then using 'omp declare variant' / OpenACC's 'bind' clause for them.

Additionally, some might prefer it to effectively force mandatory on-device
calculation and to save some bytes from the generated binary.


However, I note that the (main) reason that Clang got it was a different one
according to the reasoning given in the commit:

https://github.com/llvm/llvm-project/commit/47d66255701a5cfeab6c05e3642a2cccf7a4c09f
    Date:   Thu Apr 21 20:13:33 2022 -0400

    [OpenMP] Add options to only compile the host or device when offloading

    OpenMP recently moved to the new offloading driver, this had the effect
    of making it more difficult to inspect intermediate code for the device.
    This patch adds `-foffload-host-only` and `-foffload-device-only` to
    control which sides get compiled. This will allow users to more easily
    inspect output without needing the temp files.

    Reviewed By: tra

    Differential Revision: https://reviews.llvm.org/D124220

It uses:

def offload_device_only : Flag<["--"], "offload-device-only">,
  HelpText<"Only compile for the offloading device.">;

def offload_host_only : Flag<["--"], "offload-host-only">,
  HelpText<"Only compile for the offloading host.">;

def offload_host_device : Flag<["--"], "offload-host-device">,
  HelpText<"Only compile for the offloading host.">;

             reply	other threads:[~2022-05-19 15:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19 15:13 burnus at gcc dot gnu.org [this message]
2022-05-20  6:31 ` [Bug middle-end/105662] " rguenth 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-105662-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).