[llvm] [Offload] Add device UID (PR #164391)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 21 09:58:37 PDT 2025
================
@@ -1524,11 +1527,18 @@ Error GenericDeviceTy::enqueueHostCall(void (*Callback)(void *), void *UserData,
return Err;
}
+Expected<InfoTreeNode> GenericDeviceTy::obtainInfo() {
+ Expected<InfoTreeNode> Info = obtainInfoImpl();
+ if (Info)
+ Info->add("UID", DeviceUid, "", DeviceInfo::UID);
+ return Info;
+}
+
Error GenericDeviceTy::printInfo() {
- auto Info = obtainInfoImpl();
+ Expected<InfoTreeNode> Info = obtainInfo();
// Get the vendor-specific info entries describing the device properties.
- if (auto Err = Info.takeError())
+ if (Error Err = Info.takeError())
----------------
shiltian wrote:
LLVM generally doesn't encourage to use `auto`, unless it is well clear. I second this change, though it could be an NFC.
https://github.com/llvm/llvm-project/pull/164391
More information about the llvm-commits
mailing list