[Openmp-commits] [openmp] [OpenMP] Enable automatic unified shared memory on MI300A. (PR #77512)
via Openmp-commits
openmp-commits at lists.llvm.org
Thu Jan 18 16:16:48 PST 2024
================
@@ -183,6 +183,29 @@ Error asyncMemCopy(bool UseMultipleSdmaEngines, void *Dst, hsa_agent_t DstAgent,
#endif
}
+Expected<std::string> getTargetTripleAndFeatures(hsa_agent_t Agent) {
+ std::string Target;
+ auto Err = utils::iterateAgentISAs(Agent, [&](hsa_isa_t ISA) {
+ uint32_t Length;
+ hsa_status_t Status;
+ Status = hsa_isa_get_info_alt(ISA, HSA_ISA_INFO_NAME_LENGTH, &Length);
+ if (Status != HSA_STATUS_SUCCESS)
+ return Status;
+
+ llvm::SmallVector<char> ISAName(Length);
+ Status = hsa_isa_get_info_alt(ISA, HSA_ISA_INFO_NAME, ISAName.begin());
+ if (Status != HSA_STATUS_SUCCESS)
+ return Status;
+
+ llvm::StringRef TripleTarget(ISAName.begin(), Length);
+ if (TripleTarget.consume_front("amdgcn-amd-amdhsa"))
+ Target = TripleTarget.ltrim('-').rtrim('\0').str();
+ return HSA_STATUS_SUCCESS;
----------------
carlobertolli wrote:
We really loop over a single agent and I checked with rocr team: it can only resolve in a single isa. I am guessing that the HSA API (of which ROCr is only an implementation) leaves room for multiple ISAs associated with each agent, but that doesn't happen in this case.
https://github.com/llvm/llvm-project/pull/77512
More information about the Openmp-commits
mailing list