Skip to content

Commit c8bba3a

Browse files
committed
[L0] make device id an optional
Since device id is initialized later (not in ctor), make it optional to avoid using uninitialized value.
1 parent e02d78b commit c8bba3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/adapters/level_zero/device.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct ur_device_handle_t_ : _ur_object {
6161
ur_device_handle_t_(ze_device_handle_t Device, ur_platform_handle_t Plt,
6262
ur_device_handle_t ParentDevice = nullptr)
6363
: ZeDevice{Device}, Platform{Plt}, RootDevice{ParentDevice},
64-
ZeDeviceProperties{}, ZeDeviceComputeProperties{} {
64+
ZeDeviceProperties{}, ZeDeviceComputeProperties{}, Id(std::nullopt) {
6565
// NOTE: one must additionally call initialize() to complete
6666
// UR device creation.
6767
}
@@ -229,5 +229,5 @@ struct ur_device_handle_t_ : _ur_object {
229229
ZeOffsetToImageHandleMap;
230230

231231
// unique ephemeral identifer of the device in the adapter
232-
DeviceId Id;
232+
std::optional<DeviceId> Id;
233233
};

0 commit comments

Comments
 (0)