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

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 07:09:33 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));
----------------
ro-i wrote:

there's one issue, tho. Who owns the string? Because I should return `const char*` since that's also what we're returning from `omp_get_uid_from_device`.

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


More information about the llvm-commits mailing list