Filter L0 Debugger support by platfom

Related-To: NEO-6678
Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
Brandon Yates 2022-02-18 17:01:54 +00:00 committed by Compute-Runtime-Automation
parent 489dd4dd03
commit d70b1a2e2a
22 changed files with 70 additions and 20 deletions

View File

@ -730,6 +730,11 @@ ze_result_t DeviceImp::getDebugProperties(zet_device_debug_properties_t *pDebugP
isDebugAttachAvailable = false;
}
auto &hwInfo = neoDevice->getHardwareInfo();
if (!hwInfo.capabilityTable.l0DebuggerSupported) {
isDebugAttachAvailable = false;
}
if (isDebugAttachAvailable && !isSubdevice) {
pDebugProperties->flags = zet_device_debug_property_flag_t::ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH;
} else {

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -13,6 +13,10 @@
namespace L0 {
std::unique_ptr<NEO::Debugger> DebuggerL0::create(NEO::Device *device) {
auto &hwInfo = device->getHardwareInfo();
if (!hwInfo.capabilityTable.l0DebuggerSupported) {
return nullptr;
}
auto success = initDebuggingInOs(device->getRootDeviceEnvironment().osInterface.get());
if (success) {
auto debugger = debuggerL0Factory[device->getHardwareInfo().platform.eRenderCoreFamily](device);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -63,7 +63,8 @@ TEST_F(DebugApiTest, givenSubDeviceWhenCallingDebugAttachThenErrorIsReturned) {
EXPECT_EQ(nullptr, debugSession);
}
TEST_F(DebugApiTest, givenDeviceWhenDebugAttachIsAvaialbleThenGetPropertiesReturnsCorrectFlag) {
using isDebugSupportedProduct = IsWithinProducts<IGFX_DG1, IGFX_PVC>;
HWTEST2_F(DebugApiTest, givenDeviceWhenDebugAttachIsAvaialbleThenGetPropertiesReturnsCorrectFlag, isDebugSupportedProduct) {
zet_device_debug_properties_t debugProperties = {};
debugProperties.flags = ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32;
@ -75,6 +76,19 @@ TEST_F(DebugApiTest, givenDeviceWhenDebugAttachIsAvaialbleThenGetPropertiesRetur
EXPECT_EQ(ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH, debugProperties.flags);
}
using isDebugNotSupportedProduct = IsNotWithinProducts<IGFX_DG1, IGFX_PVC>;
HWTEST2_F(DebugApiTest, givenDeviceWhenDebugIsNotSupportedThenGetPropertiesReturnsCorrectFlag, isDebugNotSupportedProduct) {
zet_device_debug_properties_t debugProperties = {};
debugProperties.flags = ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32;
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new OsInterfaceWithDebugAttach);
auto result = zetDeviceGetDebugProperties(device->toHandle(), &debugProperties);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(0u, debugProperties.flags);
}
TEST_F(DebugApiTest, givenStateSaveAreaHeaderUnavailableWhenGettingDebugPropertiesThenAttachFlagIsNotReturned) {
zet_device_debug_properties_t debugProperties = {};
debugProperties.flags = ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32;

View File

@ -82,7 +82,8 @@ const RuntimeCapabilityTable EHL::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false // fusedEuEnabled
false, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable EHL::workaroundTable = {};

View File

@ -83,7 +83,8 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false // fusedEuEnabled
false, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable ICLLP::workaroundTable = {};

View File

@ -82,7 +82,8 @@ const RuntimeCapabilityTable LKF::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false // fusedEuEnabled
false, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable LKF::workaroundTable = {};

View File

@ -80,7 +80,8 @@ const RuntimeCapabilityTable ADLP::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
true // fusedEuEnabled
true, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable ADLP::workaroundTable = {};

View File

@ -80,7 +80,8 @@ const RuntimeCapabilityTable ADLS::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
true // fusedEuEnabled
true, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable ADLS::workaroundTable = {};

View File

@ -88,7 +88,8 @@ const RuntimeCapabilityTable DG1::capabilityTable{
true, // supportsMediaBlock
true, // p2pAccessSupported
false, // p2pAtomicAccessSupported
true // fusedEuEnabled
true, // fusedEuEnabled
true, // l0DebuggerSupported;
};
WorkaroundTable DG1::workaroundTable = {};

View File

@ -80,7 +80,8 @@ const RuntimeCapabilityTable RKL::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
true // fusedEuEnabled
true, // fusedEuEnabled
false, // l0DebuggerSupported;
};
WorkaroundTable RKL::workaroundTable = {};

View File

@ -84,7 +84,8 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
true // fusedEuEnabled
true, // fusedEuEnabled
false, // l0DebuggerSupported;
};
WorkaroundTable TGLLP::workaroundTable = {};

View File

@ -87,7 +87,8 @@ const RuntimeCapabilityTable BDW::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false // fusedEuEnabled
false, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable BDW::workaroundTable = {};

View File

@ -84,7 +84,8 @@ const RuntimeCapabilityTable BXT::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false // fusedEuEnabled
false, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable BXT::workaroundTable = {};

View File

@ -79,7 +79,8 @@ const RuntimeCapabilityTable CFL::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false // fusedEuEnabled
false, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable CFL::workaroundTable = {};

View File

@ -79,7 +79,8 @@ const RuntimeCapabilityTable GLK::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false // fusedEuEnabled
false, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable GLK::workaroundTable = {};

View File

@ -79,7 +79,8 @@ const RuntimeCapabilityTable KBL::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false // fusedEuEnabled
false, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable KBL::workaroundTable = {};

View File

@ -87,7 +87,8 @@ const RuntimeCapabilityTable SKL::capabilityTable{
true, // supportsMediaBlock
false, // p2pAccessSupported
false, // p2pAtomicAccessSupported
false // fusedEuEnabled
false, // fusedEuEnabled
false // l0DebuggerSupported;
};
WorkaroundTable SKL::workaroundTable = {};

View File

@ -68,6 +68,7 @@ struct RuntimeCapabilityTable {
bool p2pAccessSupported;
bool p2pAtomicAccessSupported;
bool fusedEuEnabled;
bool l0DebuggerSupported;
};
inline bool operator==(const RuntimeCapabilityTable &lhs, const RuntimeCapabilityTable &rhs) {
@ -133,6 +134,7 @@ inline bool operator==(const RuntimeCapabilityTable &lhs, const RuntimeCapabilit
result &= (lhs.isIntegratedDevice == rhs.isIntegratedDevice);
result &= (lhs.supportsMediaBlock == rhs.supportsMediaBlock);
result &= (lhs.fusedEuEnabled == rhs.fusedEuEnabled);
result &= (lhs.l0DebuggerSupported == rhs.l0DebuggerSupported);
return result;
}

View File

@ -84,7 +84,8 @@ const RuntimeCapabilityTable XE_HP_SDV::capabilityTable{
true, // supportsMediaBlock
true, // p2pAccessSupported
false, // p2pAtomicAccessSupported
true // fusedEuEnabled
true, // fusedEuEnabled
true // l0DebuggerSupported;
};
WorkaroundTable XE_HP_SDV::workaroundTable = {};

View File

@ -93,7 +93,8 @@ const RuntimeCapabilityTable PVC::capabilityTable{
false, // supportsMediaBlock
true, // p2pAccessSupported
true, // p2pAtomicAccessSupported
false // fusedEuEnabled
false, // fusedEuEnabled
true // l0DebuggerSupported;
};
void PVC::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {

View File

@ -84,7 +84,8 @@ const RuntimeCapabilityTable DG2::capabilityTable{
true, // supportsMediaBlock
true, // p2pAccessSupported
false, // p2pAtomicAccessSupported
true // fusedEuEnabled
true, // fusedEuEnabled
true // l0DebuggerSupported
};
WorkaroundTable DG2::workaroundTable = {};

View File

@ -849,6 +849,14 @@ struct IsWithinProducts {
}
};
template <PRODUCT_FAMILY productFamilyMin, PRODUCT_FAMILY productFamilyMax>
struct IsNotWithinProducts {
template <PRODUCT_FAMILY productFamily>
static constexpr bool isMatched() {
return (productFamily < productFamilyMin) || (productFamily > productFamilyMax);
}
};
struct MatchAny {
template <PRODUCT_FAMILY productFamily>
static constexpr bool isMatched() { return true; }