[Openmp-commits] [PATCH] D156387: [OpenMP][Docs] Added offloading command line reference to OpenMP FAQ

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 27 14:29:44 PDT 2023


jhuber6 added a comment.

Thinking we should put these in a separate file and have the FAQ link to it.



================
Comment at: openmp/docs/SupportAndFAQ.rst:89
 
 Q: How to build an OpenMP AMDGPU offload capable compiler?
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
----------------
Unrelated, but this section definitely needs to be updated either by me or @JonChesterfield.


================
Comment at: openmp/docs/SupportAndFAQ.rst:468
+``--offload-arch=sm_80`` to target an Nvidia Tesla A100 or 
+``--offload-arch=gfx90a`` to target an AMD Instinct MI250X.
+
----------------
jdoerfert wrote:
> Mention auto detection (for the machine used for compiling) and mention {amdgpu,nvptx}-arch executables together with the "key" that corresponds to the sub architecture.
Add a line showing that `--offload-arch=sm_80,gfx90a` does both.


================
Comment at: openmp/docs/SupportAndFAQ.rst:472
+"""""""""""""""""""""""""
+Compile the target regions for the device only. All target regions will be 
+compiled for both host and device if not specified.
----------------
Maybe worth mentioning that this is primarily used for checking the IR output when compiling for the device.


================
Comment at: openmp/docs/SupportAndFAQ.rst:477-478
+""""""""""""""""""""""""""""""""""""""""""""""""""""
+Compile the target regions for the host only. All target regions will be 
+compiled for both host and device if not specified.
+
----------------
jplehr wrote:
> AntonRydahl wrote:
> > jplehr wrote:
> > > Flip the flags or the sentences, so that the flags and their meaning are in the same order.
> > Thank you for pointing this out! I thought the two flags had the same meaning as they had the same description in the Clang command line reference. 
> > 
> > ```
> > clang --help | grep offload-host-device
> >   --offload-host-device   Only compile for the offloading host.
> > clang --help | grep offload-host-only
> >   --offload-host-only     Only compile for the offloading host.
> > ```
> > 
> > What exactly is the difference between the two flags?
> To be honest, I only guessed from their name, hopefully someone else knows. My interpretation:
> ``--offload-host-device`` -> Compile for host and device
> ``--offload-host-only`` -> Compile for host only
> 
> Let's try summoning @jdoerfert or @jhuber6 
`--offload-host-only` skips the device portion, has the effect of not having the `.llvm.offloading` section where the embedded device code would otherwise live, check the IR and you'll see the lack of a giant binary string.


================
Comment at: openmp/docs/SupportAndFAQ.rst:482
+"""""""""""""""""""""""""
+Pass an argument to the offloading toolchain, for instance 
+``-Xopenmp-target -march=sm_80``.
----------------
jplehr wrote:
> have in this and the next paragraph also "Pass an argument ``<arg>`` ... " as it is written further down.
You can also use `-Xarch_device` and `-Xarch_host` which are worth mentioning.


================
Comment at: openmp/docs/SupportAndFAQ.rst:527
+
+``--offload-new-driver``
+""""""""""""""""""""""""
----------------
AntonRydahl wrote:
> jplehr wrote:
> > Should be indicated which one is the default, i.e., old or new?
> In `clang/lib/Driver/ToolChains/Clang.cpp` the following means that it is turned off by default, right?
> 
> ```
> 6343-  if (Args.hasFlag(options::OPT_offload_new_driver,
> 6344-                   options::OPT_no_offload_new_driver, false))
> 6345:    CmdArgs.push_back("--offload-new-driver");
> ```
> 
Upstream, OpenMP only  uses the new driver. This flag is for enabling it for CUDA / HIP so that it can be interoperable w/ OpenMP.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156387/new/

https://reviews.llvm.org/D156387



More information about the Openmp-commits mailing list