-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[Offload] Change HSA header search order #95769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary: The HSA headers existed previously in `include/hsa.h` and were moved to `include/hsa/hsa.h` in a later ROCm version. The include headers here were originally designed to favor a newer one. However, this unintentionally prevented the dyanmic HSA's `hsa.h` from being used if both were present. This patch changes the order so it will be found first. Related to llvm#95484.
@llvm/pr-subscribers-backend-amdgpu @llvm/pr-subscribers-offload Author: Joseph Huber (jhuber6) ChangesSummary: Related to #95484. Full diff: https://github.com/llvm/llvm-project/pull/95769.diff 1 Files Affected:
diff --git a/offload/plugins-nextgen/amdgpu/src/rtl.cpp b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
index 26bca4a3674bd..f16d150720206 100644
--- a/offload/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -57,12 +57,12 @@
#endif
#if defined(__has_include)
-#if __has_include("hsa/hsa.h")
-#include "hsa/hsa.h"
-#include "hsa/hsa_ext_amd.h"
-#elif __has_include("hsa.h")
+#if __has_include("hsa.h")
#include "hsa.h"
#include "hsa_ext_amd.h"
+#elif __has_include("hsa/hsa.h")
+#include "hsa/hsa.h"
+#include "hsa/hsa_ext_amd.h"
#endif
#else
#include "hsa/hsa.h"
|
I think https://discourse.llvm.org/t/18-1-7-released/79433 said there would be no LLVM 18 unless there is serious issue. Not sure this would be counted as one. @tstellar |
Alright, so we'll just carry this fix into 19.x then. |
I'm actually not sure why the order makes a difference here? Is the issue caused by existence of |
We add |
I think this sounds very hacky. Does it work if we do |
No, because the logic in the file explicitly includes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the issue. LG.
Summary:
The HSA headers existed previously in
include/hsa.h
and were moved toinclude/hsa/hsa.h
in a later ROCm version. The include headers herewere originally designed to favor a newer one. However, this
unintentionally prevented the dyanmic HSA's
hsa.h
from being used ifboth were present. This patch changes the order so it will be found
first.
Related to #95484.