Skip to content

Commit 73f448d

Browse files
committed
make virtual host devices have UIDs different from the initial device
1 parent 3b261ed commit 73f448d

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

offload/liboffload/src/OffloadImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ Error olGetDeviceInfoImplDetailHost(ol_device_handle_t Device,
546546
case OL_DEVICE_INFO_PRODUCT_NAME:
547547
return Info.writeString("Virtual Host Device");
548548
case OL_DEVICE_INFO_UID:
549-
return Info.writeString(GenericPluginTy::getHostDeviceUid());
549+
return Info.writeString(GenericPluginTy::getInitialDeviceUid());
550550
case OL_DEVICE_INFO_VENDOR:
551551
return Info.writeString("Liboffload");
552552
case OL_DEVICE_INFO_DRIVER_VERSION:

offload/plugins-nextgen/common/include/PluginInterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,8 +1304,8 @@ struct GenericPluginTy {
13041304
return getDevice(DeviceId).getDeviceUid();
13051305
}
13061306

1307-
/// Get the UID for the host device.
1308-
static constexpr const char *getHostDeviceUid() { return "HOST"; }
1307+
/// Get the UID for the initial (= host) device.
1308+
static constexpr const char *getInitialDeviceUid() { return "HOST"; }
13091309

13101310
/// Get the ELF code to recognize the binary image of this plugin.
13111311
virtual uint16_t getMagicElfBits() const = 0;

offload/plugins-nextgen/host/src/rtl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ struct GenELF64DeviceTy : public GenericDeviceTy {
148148
/// Create the device with a specific id.
149149
GenELF64DeviceTy(GenericPluginTy &Plugin, int32_t DeviceId,
150150
int32_t NumDevices)
151-
: GenericDeviceTy(Plugin, DeviceId, NumDevices, GenELF64GridValues) {
152-
DeviceUid = Plugin.getHostDeviceUid();
153-
}
151+
: GenericDeviceTy(Plugin, DeviceId, NumDevices, GenELF64GridValues) {}
154152

155153
~GenELF64DeviceTy() {}
156154

0 commit comments

Comments
 (0)