[llvm] [Offload] Add device UID (PR #164391)
    Kevin Sala Penades via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Oct 21 10:04:58 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())
----------------
kevinsala wrote:
Most error returns in the plugins are using `auto`, mainly because it's already clear by the variable name. In this case, I don't think it's necessary. But I understand it is in the cases of `Expected<Something>`.
https://github.com/llvm/llvm-project/pull/164391
    
    
More information about the llvm-commits
mailing list