[llvm] [Offload][AMDGPU] accept generic target (PR #118919)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 5 20:39:36 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)
----------------
hidekisaito wrote:
OK. Will change. C++23 has contains()...
https://github.com/llvm/llvm-project/pull/118919
More information about the llvm-commits
mailing list