[llvm] [Offload][AMDGPU] accept generic target (PR #118919)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 6 04:47:49 PST 2024
================
@@ -1988,12 +1991,11 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
return Err;
// Detect if XNACK is enabled
- auto TargeTripleAndFeaturesOrError =
- hsa_utils::getTargetTripleAndFeatures(Agent);
- if (!TargeTripleAndFeaturesOrError)
- return TargeTripleAndFeaturesOrError.takeError();
- if (static_cast<StringRef>(*TargeTripleAndFeaturesOrError)
- .contains("xnack+"))
+ SmallVector<std::string> Targets;
+ Targets.push_back("");
+ if (auto Err = hsa_utils::getTargetTripleAndFeatures(Agent, Targets))
+ return Err;
+ if (Targets[0].find("xnack+") != std::string::npos)
----------------
arsenm wrote:
Should basically never use std::string
https://github.com/llvm/llvm-project/pull/118919
More information about the llvm-commits
mailing list