-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Fix to account for multiple ISA enumeration #118676
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
|
@llvm/pr-subscribers-offload @llvm/pr-subscribers-backend-amdgpu Author: None (hidekisaito) ChangesFull diff: https://github.com/llvm/llvm-project/pull/118676.diff 1 Files Affected:
diff --git a/offload/plugins-nextgen/amdgpu/src/rtl.cpp b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
index 22c8079ab5812f..d74e65d4165679 100644
--- a/offload/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -207,7 +207,7 @@ Expected<std::string> getTargetTripleAndFeatures(hsa_agent_t Agent) {
llvm::StringRef TripleTarget(ISAName.begin(), Length);
if (TripleTarget.consume_front("amdgcn-amd-amdhsa"))
Target = TripleTarget.ltrim('-').rtrim('\0').str();
- return HSA_STATUS_SUCCESS;
+ return HSA_STATUS_INFO_BREAK;
});
if (Err)
return Err;
|
jhuber6
left a comment
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.
Good short-term fix, long term we just need to handle multiple of these and push them back. Then we can scan all the ISAs from least generic to most generic through some complicated lookup table.
This is not a short term fix. The iteration always starts from specific to generic, so there must be only one match. It is just code error not stopping it on the first match. I also don't think it's a good idea to maintain a match table at OpenMP level. |
|
Also, this PR doesn't have proper prefix, such as |
Forgot to fix that before I hit merge.
That's not what the code is doing, it's copying out the first result to then do a comparison. Maybe we could move the check inside of the iterate callback and then break when we first find a match?
Not the OpenMP level, we need one at the ELF flags level. |
The generic ELF has to match generic ISA provided by HSA. There is no need to do that at the ELF flag level. For example, if the ELF is
Right, that should be the right approach IMHO. |
Change-Id: Ie4d44d413b91a47bf3774f112d29438139d9c929
When multiple ISAs are enumerated per agent, existing code picked up the last one. Incumbent is the first one and thus the fixed code picks up the first one. This fix is expected to be short-lived --- to be followed by code object version 6 generic ISA support.