[llvm] [Offload] Add device UID (PR #164391)
Robert Imschweiler via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 22 09:56:29 PDT 2025
================
@@ -1196,6 +1202,14 @@ struct GenericDeviceTy : public DeviceAllocatorTy {
/// global device id and is not the device id visible to the OpenMP user.
const int32_t DeviceId;
+ /// The unique identifier of the device.
+ /// Per default, the unique identifier of the device is set to the device id,
+ /// combined with the plugin name, since the offload device id may overlap
+ /// between different plugins.
+ std::string DeviceUid;
+ /// Construct the device UID from the vendor (U)UID.
+ void setDeviceUidFromVendorUid(StringRef VendorUid);
----------------
ro-i wrote:
I mean, I get the UUID in the initImpl, because that's where all the other info-retrieving calls to the vendor libs are.
I could also store that UUID as an attribute and construct the DeviceUid in getDeviceUid(). Would you feel better about that version compared to directly computing DeviceUid and just returning it in getDeviceUid() (aka the current state)?
https://github.com/llvm/llvm-project/pull/164391
More information about the llvm-commits
mailing list