[PATCH] D141859: [amdgpu-arch] Dynamically load the HSA runtime if not found during the build

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 16 09:01:15 PST 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, tra, yaxunl, JonChesterfield, gregrodgers.
Herald added subscribers: kosarev, kerbowa, tpr, dstuttard, jvesely, kzhuravl.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: cfe-commits, wdng.
Herald added a project: clang.

We use the `amdgpu-arch` tool to query the installed GPUs at runtime.
One problem is that this tool is currently not build if the person
building the LLVM binary does not have the HSA runtime on their system.
This means that if someone built and distrubted an installation of LLVM
without HSA, then the user will not be able to use it even if they have
it on their system.

This patch makes us build this tool unconditionally and adds extra logic
to dynamically load HSA if it's present.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141859

Files:
  clang/tools/amdgpu-arch/AMDGPUArch.cpp
  clang/tools/amdgpu-arch/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141859.489580.patch
Type: text/x-patch
Size: 4354 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230116/bbaf8081/attachment.bin>


More information about the cfe-commits mailing list