Add sysman handles for subdevice only after subdevices are created

Move location of assigning sysman handles, such that sysman handle
will be assigned to device and then assign that sysman handle
to subdevices of that device.

Change-Id: Ia606954a866c491e45803b903c8419ee09b1a939
Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
Jitendra Sharma
2020-10-29 15:20:21 +05:30
committed by sys_ocldev
parent 3e4079574c
commit 17970ad5e7
3 changed files with 19 additions and 5 deletions

View File

@@ -20,6 +20,10 @@ SysmanDevice *SysmanDeviceHandleContext::init(ze_device_handle_t coreDevice) {
SysmanDeviceImp *sysmanDevice = new SysmanDeviceImp(coreDevice);
UNRECOVERABLE_IF(!sysmanDevice);
sysmanDevice->init();
L0::DeviceImp *device = static_cast<DeviceImp *>(Device::fromHandle(coreDevice));
for (auto &subDevice : device->subDevices) {
static_cast<DeviceImp *>(subDevice)->setSysmanHandle(sysmanDevice);
}
return sysmanDevice;
}