[PATCH] D150998: [OpenMP] Fix using the target ID when using the new driver
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 7 08:43:11 PDT 2023
yaxunl added a comment.
In D150998#4403416 <https://reviews.llvm.org/D150998#4403416>, @jhuber6 wrote:
> In D150998#4403401 <https://reviews.llvm.org/D150998#4403401>, @yaxunl wrote:
>
>> In D150998#4403359 <https://reviews.llvm.org/D150998#4403359>, @jhuber6 wrote:
>>
>>> Can we use this approach for now and land this? It makes the "new driver" less broken than it currently is as it supports target ID compilation in the general term. Fixing the merging rules will be a rather large overhaul so I'd like this to work in the meantime.
>>>
>>> This patch allows `--offload-arch=gfx90a:xnack+` to work. It does not fix if the user links in a library that has `--offload-arch=gfx90a:xnack-` as well.
>>
>> can we add a test to make sure `--offload-arch=gfx90a:xnack+` and `--offload-arch=gfx90a:xnack-` work together? It is a very common use case for HIP.
>
> With the current patch, they would both be linked together and it would probably set the `xnack` value to the last one that showed up in the link list. E.g.
>
> clang -xhip a.c --offload-arch=gfx90a:xnack+ --offload-new-driver -fgpu-rdc
> clang -xhip b.c --offload-arch=gfx90a:xnack- --offload-new-driver -fgpu-rdc
> clang --offload-link a.o b.o
>
> Would result in a.o and b.o getting linked together with `xnack-` set as the backend attribute.
what happens to
clang -xhip a.c --offload-arch=gfx90a:xnack+ --offload-arch=gfx90a:xnack- --offload-new-driver -fgpu-rdc
clang -xhip b.c --offload-arch=gfx90a:xnack+ --offload-arch=gfx90a:xnack- --offload-new-driver -fgpu-rdc
clang --offload-link a.o b.o
Basically gfx90a:xnack+ and gfx90a:xnack- need to be treated as distinct GPU arch's and the fat binary should contain different code objects for them.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150998/new/
https://reviews.llvm.org/D150998
More information about the cfe-commits
mailing list