[llvm] [Offload][AMDGPU] accept generic target (PR #118919)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 6 17:15:19 PST 2024
================
@@ -205,13 +206,19 @@ Expected<std::string> getTargetTripleAndFeatures(hsa_agent_t Agent) {
return Status;
llvm::StringRef TripleTarget(ISAName.begin(), Length);
- if (TripleTarget.consume_front("amdgcn-amd-amdhsa"))
- Target = TripleTarget.ltrim('-').rtrim('\0').str();
- return HSA_STATUS_INFO_BREAK;
+ if (TripleTarget.consume_front("amdgcn-amd-amdhsa")) {
+ auto Target = TripleTarget.ltrim('-').rtrim('\0');
+ Targets.push_back(Target);
+ if (!Target.ends_with("generic"))
+ SpecificTarget = Target; // Expect one (and only one) to be found
----------------
hidekisaito wrote:
If desired, we could add an assertion for SpecificTarget still empty before assigning, which might help catch HSA behavior change.
https://github.com/llvm/llvm-project/pull/118919
More information about the llvm-commits
mailing list