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

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 07:53:04 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:

Yeah, just remembered that this would need to be thread safe. Ehhh, not a fan of more random data we initialize but I guess we need to do it. Don't have a `set` interface, just initialize it when we initialize it I guess.

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


More information about the llvm-commits mailing list