[PATCH] D154123: [HIP] Start document HIP support by clang

Ronan Keryell via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 24 16:41:37 PDT 2023


keryell added inline comments.


================
Comment at: clang/docs/HIPSupport.rst:30
+
+Clang provides partial HIP support on Intel GPUs using the CHIP-Star project `<https://github.com/CHIP-SPV/chipStar>`_. CHIP-Star implements the HIP runtime over oneAPI Level Zero or OpenCL runtime. The Clang driver uses the HIPSPV toolchain to compile HIP device code into LLVM IR, which is subsequently translated to SPIRV via the SPIRV backend or the out-of-tree LLVM-SPIRV translator. The SPIRV is then bundled and embedded into the host executables.
+
----------------
Fix the spelling when we talk about the Khronos SPIR-V standard, by opposition to tool names.
Perhaps you can split the line in shorter ones so the diff are more obvious.


================
Comment at: clang/docs/HIPSupport.rst:65
+
+   clang++ --offload-arch=gfx906 -xhip sample.cpp -o sample
+
----------------
yaxunl wrote:
> arsenm wrote:
> > scchan wrote:
> > > missing --hip-link
> > What does hip-link do? Why is it needed? I never use it and it works
> It indicates HIP offloading at the linking stage and creates the HIP toolchain.
> 
> For -fno-gpu-rdc mode, it locates the HIP runtime library and links it.
> 
> For -fgpu-rdc mode, it unbundles object files and does device linking and embedding.
I am a little lost here.
I have the feeling that the newbie syntax (compile+link in one invocation) should be
```
clang++ --offload-arch=gfx906 -xhip sample.cpp -o sample
```
since it should be obvious to the Driver that we want to produce a working program for a GPU.
Or does this work producing a working program with another meaning?


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

https://reviews.llvm.org/D154123



More information about the cfe-commits mailing list