Skip to content

Commit 24ed89e

Browse files
refactor: simplify debug attach capability detection
Signed-off-by: Mateusz Hoppe <[email protected]>
1 parent a929551 commit 24ed89e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

level_zero/core/source/device/device_imp.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,23 +1359,23 @@ ze_result_t DeviceImp::getDeviceImageProperties(ze_device_image_properties_t *pD
13591359

13601360
ze_result_t DeviceImp::getDebugProperties(zet_device_debug_properties_t *pDebugProperties) {
13611361
bool isDebugAttachAvailable = getOsInterface() ? getOsInterface()->isDebugAttachAvailable() : false;
1362-
auto &stateSaveAreaHeader = NEO::SipKernel::getDebugSipKernel(*this->getNEODevice()).getStateSaveAreaHeader();
1363-
1364-
if (stateSaveAreaHeader.size() == 0) {
1365-
PRINT_DEBUGGER_INFO_LOG("Context state save area header missing", "");
1366-
isDebugAttachAvailable = false;
1367-
}
1362+
pDebugProperties->flags = 0;
13681363

13691364
auto &hwInfo = neoDevice->getHardwareInfo();
13701365
if (!hwInfo.capabilityTable.l0DebuggerSupported) {
13711366
isDebugAttachAvailable = false;
13721367
}
1373-
1374-
bool tileAttach = NEO::debugManager.flags.ExperimentalEnableTileAttach.get();
1375-
pDebugProperties->flags = 0;
13761368
if (isDebugAttachAvailable) {
1377-
if ((isSubdevice && tileAttach) || !isSubdevice) {
1378-
pDebugProperties->flags = zet_device_debug_property_flag_t::ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH;
1369+
auto &stateSaveAreaHeader = NEO::SipKernel::getDebugSipKernel(*this->getNEODevice()).getStateSaveAreaHeader();
1370+
1371+
if (stateSaveAreaHeader.size() == 0) {
1372+
PRINT_DEBUGGER_INFO_LOG("Context state save area header missing", "");
1373+
} else {
1374+
bool tileAttach = NEO::debugManager.flags.ExperimentalEnableTileAttach.get();
1375+
1376+
if ((isSubdevice && tileAttach) || !isSubdevice) {
1377+
pDebugProperties->flags = zet_device_debug_property_flag_t::ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH;
1378+
}
13791379
}
13801380
}
13811381
return ZE_RESULT_SUCCESS;

0 commit comments

Comments
 (0)