[llvm] [Offload] Add device UID (PR #164391)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 07:42:07 PST 2025


================
@@ -293,6 +294,12 @@ struct CUDADeviceTy : public GenericDeviceTy {
     if (auto Err = Plugin::check(Res, "error in cuDeviceGet: %s"))
       return Err;
 
+    CUuuid UUID = {0};
+    Res = cuDeviceGetUuid(&UUID, Device);
+    if (auto Err = Plugin::check(Res, "error in cuDeviceGetUuid: %s"))
+      return Err;
+    setDeviceUidFromVendorUid(toHex(UUID.bytes, true));
----------------
jhuber6 wrote:

Riiiight, well that API probably should've been implemented as to not rely on permanent storage but I guess that's moot. Could probably just cache it at the  OpenMP layer in a map of device pointers to strings and return the pointer and look it up if empty, then return it.

https://github.com/llvm/llvm-project/pull/164391


More information about the llvm-commits mailing list