[llvm-branch-commits] [openmp] release/18.x: [OpenMP][OMPT] Fix hsa include when building amdgpu/src/rtl.cpp (PR #95484)

Thomas Debesse via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Jun 16 20:33:10 PDT 2024


illwieckz wrote:

> I don't think AMD handles the actual packaging.

They do: https://repo.radeon.com

It happens that Ubuntu provides an old 5.2.3 `libhsa-runtime-dev` and it seems to be a dependency of some package provided by the AMD `repo.radeon.com` own repository providing ROCm 6.1.2…

> It does in the main branch, but I think you're right that the logic causes it to look at the system one first since `hsa/hsa.h` is higher up the search list. Should probably do something about that.

Maybe, instead of adding `dynamic_hsa/` directory to include directories and assuming an ambiguous implicit directory for `hsa.h`, we would not add that directory and do explicitely:


```c++
#if defined(__has_include)
#if __has_include("dynamic_hsa/hsa.h")
#include "dynamic_hsa/hsa.h"
#include "dynamic_hsa/hsa_ext_amd.h"
#if __has_include("hsa/hsa.h")
#include "hsa/hsa.h"
#include "hsa/hsa_ext_amd.h"
#elif __has_include("hsa.h")
#include "hsa.h"
#include "hsa_ext_amd.h"
#endif
#else
#include "dynamic_hsa/hsa.h"
#include "dynamic_hsa/hsa_ext_amd.h"
#endif
```

https://github.com/llvm/llvm-project/pull/95484


More information about the llvm-branch-commits mailing list