From 6584f58902201da5e60aac2ee49d4be149b58c3d Mon Sep 17 00:00:00 2001 From: Pawel Cieslak Date: Fri, 18 Oct 2019 10:15:09 +0200 Subject: [PATCH] Dynamic query of EUCount and SubSliceCount. Related-To: NEO-3841 Change-Id: I7b92314bb8465233909fd1dddeef4ae1469008c9 Signed-off-by: Pawel Cieslak --- runtime/dll/linux/drm_neo_create.cpp | 5 +- runtime/gen11/hw_cmds_ehl.h | 1 + runtime/gen11/hw_cmds_icllp.h | 1 + runtime/gen11/hw_cmds_lkf.h | 1 + runtime/gen11/hw_info_ehl.inl | 13 +- runtime/gen11/hw_info_icllp.inl | 31 ++-- runtime/gen11/hw_info_lkf.inl | 5 +- runtime/gen12lp/hw_cmds_tgllp.h | 1 + runtime/gen12lp/hw_info_tgllp.inl | 9 +- runtime/gen8/hw_cmds_bdw.h | 1 + runtime/gen8/hw_info_bdw.inl | 17 +-- runtime/gen9/hw_cmds_bxt.h | 1 + runtime/gen9/hw_cmds_cfl.h | 1 + runtime/gen9/hw_cmds_glk.h | 1 + runtime/gen9/hw_cmds_kbl.h | 1 + runtime/gen9/hw_cmds_skl.h | 1 + runtime/gen9/hw_info_bxt.inl | 9 +- runtime/gen9/hw_info_cfl.inl | 21 +-- runtime/gen9/hw_info_glk.inl | 9 +- runtime/gen9/hw_info_kbl.inl | 21 +-- runtime/gen9/hw_info_skl.inl | 21 +-- runtime/helpers/enable_product.inl | 1 + runtime/helpers/hw_info.cpp | 30 ++++ runtime/helpers/hw_info.h | 4 +- runtime/os_interface/device_factory.cpp | 8 ++ runtime/os_interface/linux/drm_neo.cpp | 25 ++++ runtime/os_interface/linux/drm_neo.h | 1 + .../ehl/linux/hw_info_config_tests_ehl.cpp | 7 +- .../gen11/ehl/test_hw_info_config_ehl.cpp | 31 +--- .../linux/hw_info_config_tests_icllp.cpp | 133 +++--------------- .../gen11/icllp/test_hw_info_config_icllp.cpp | 38 +---- .../lkf/linux/hw_info_config_tests_lkf.cpp | 6 +- .../gen11/lkf/test_hw_info_config_lkf.cpp | 17 +-- .../tgllp/test_hw_info_config_tgllp.cpp | 23 +-- .../bdw/linux/hw_info_config_tests_bdw.cpp | 6 +- .../gen8/bdw/test_hw_info_config_bdw.cpp | 39 +---- .../gen9/bxt/linux/hw_info_config_tests.cpp | 6 +- .../gen9/bxt/test_hw_info_config_bxt.cpp | 24 +--- .../cfl/linux/hw_info_config_tests_cfl.cpp | 6 +- .../gen9/cfl/test_hw_info_config_cfl.cpp | 45 +----- .../glk/linux/hw_info_config_tests_glk.cpp | 6 +- .../gen9/glk/test_hw_info_config_glk.cpp | 24 +--- .../kbl/linux/hw_info_config_tests_kbl.cpp | 6 +- .../gen9/kbl/test_hw_info_config_kbl.cpp | 45 +----- .../skl/linux/hw_info_config_tests_skl.cpp | 6 +- .../gen9/skl/test_hw_info_config_skl.cpp | 48 +------ unit_tests/linux/main_linux_dll.cpp | 16 +++ unit_tests/linux/mock_os_layer.cpp | 10 ++ unit_tests/linux/mock_os_layer.h | 2 + unit_tests/main.cpp | 9 ++ .../os_interface/device_factory_tests.cpp | 12 ++ .../os_interface/hw_info_config_tests.cpp | 16 +++ 52 files changed, 275 insertions(+), 546 deletions(-) diff --git a/runtime/dll/linux/drm_neo_create.cpp b/runtime/dll/linux/drm_neo_create.cpp index 92da9f481b..a6f1a01b8d 100644 --- a/runtime/dll/linux/drm_neo_create.cpp +++ b/runtime/dll/linux/drm_neo_create.cpp @@ -167,7 +167,10 @@ Drm *Drm::create(int32_t deviceOrdinal) { } if (device) { platformDevices[0] = device->pHwInfo; - device->setupHardwareInfo(const_cast(platformDevices[0]), true); + ret = drmObject->setupHardwareInfo(const_cast(device), true); + if (ret != 0) { + return nullptr; + } drmObject->setGtType(eGtType); } else { printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, diff --git a/runtime/gen11/hw_cmds_ehl.h b/runtime/gen11/hw_cmds_ehl.h index ad77297d9d..3618e08ae5 100644 --- a/runtime/gen11/hw_cmds_ehl.h +++ b/runtime/gen11/hw_cmds_ehl.h @@ -13,6 +13,7 @@ namespace NEO { struct EHL : public ICLFamily { static const PLATFORM platform; static const HardwareInfo hwInfo; + static const std::string defaultHardwareInfoConfig; static FeatureTable featureTable; static WorkaroundTable workaroundTable; static const uint32_t threadsPerEu = 7; diff --git a/runtime/gen11/hw_cmds_icllp.h b/runtime/gen11/hw_cmds_icllp.h index b415492c48..891568fc72 100644 --- a/runtime/gen11/hw_cmds_icllp.h +++ b/runtime/gen11/hw_cmds_icllp.h @@ -13,6 +13,7 @@ namespace NEO { struct ICLLP : public ICLFamily { static const PLATFORM platform; static const HardwareInfo hwInfo; + static const std::string defaultHardwareInfoConfig; static FeatureTable featureTable; static WorkaroundTable workaroundTable; static const uint32_t threadsPerEu = 7; diff --git a/runtime/gen11/hw_cmds_lkf.h b/runtime/gen11/hw_cmds_lkf.h index b17ea3935a..9d51c64c0c 100644 --- a/runtime/gen11/hw_cmds_lkf.h +++ b/runtime/gen11/hw_cmds_lkf.h @@ -13,6 +13,7 @@ namespace NEO { struct LKF : public ICLFamily { static const PLATFORM platform; static const HardwareInfo hwInfo; + static const std::string defaultHardwareInfoConfig; static FeatureTable featureTable; static WorkaroundTable workaroundTable; static const uint32_t threadsPerEu = 7; diff --git a/runtime/gen11/hw_info_ehl.inl b/runtime/gen11/hw_info_ehl.inl index 39ff055ae6..7f33cdb529 100644 --- a/runtime/gen11/hw_info_ehl.inl +++ b/runtime/gen11/hw_info_ehl.inl @@ -117,10 +117,8 @@ const HardwareInfo EHL_1x2x4::hwInfo = { GT_SYSTEM_INFO EHL_1x2x4::gtSystemInfo = {0}; void EHL_1x2x4::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 8; - gtSysInfo->ThreadCount = 7 * EHL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * EHL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 2; gtSysInfo->L3CacheSizeInKb = 1280; gtSysInfo->L3BankCount = 4; gtSysInfo->MaxFillRate = 8; @@ -150,10 +148,8 @@ const HardwareInfo EHL_1x4x4::hwInfo = { GT_SYSTEM_INFO EHL_1x4x4::gtSystemInfo = {0}; void EHL_1x4x4::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 16; - gtSysInfo->ThreadCount = 7 * EHL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * EHL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 4; gtSysInfo->L3CacheSizeInKb = 1280; gtSysInfo->L3BankCount = 4; gtSysInfo->MaxFillRate = 8; @@ -183,10 +179,8 @@ const HardwareInfo EHL_1x4x8::hwInfo = { GT_SYSTEM_INFO EHL_1x4x8::gtSystemInfo = {0}; void EHL_1x4x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 32; - gtSysInfo->ThreadCount = 7 * EHL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * EHL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 4; gtSysInfo->L3CacheSizeInKb = 1280; gtSysInfo->L3BankCount = 4; gtSysInfo->MaxFillRate = 8; @@ -207,6 +201,7 @@ void EHL_1x4x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAn }; const HardwareInfo EHL::hwInfo = EHL_1x4x8::hwInfo; +const std::string EHL::defaultHardwareInfoConfig = "1x4x8"; void setupEHLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig) { if (hwInfoConfig == "1x4x8") { diff --git a/runtime/gen11/hw_info_icllp.inl b/runtime/gen11/hw_info_icllp.inl index 341ab04bdd..ecb7d32559 100644 --- a/runtime/gen11/hw_info_icllp.inl +++ b/runtime/gen11/hw_info_icllp.inl @@ -119,10 +119,8 @@ const HardwareInfo ICLLP_1x8x8::hwInfo = { GT_SYSTEM_INFO ICLLP_1x8x8::gtSystemInfo = {0}; void ICLLP_1x8x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 63; - gtSysInfo->ThreadCount = 63 * ICLLP::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * ICLLP::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 8; gtSysInfo->L3CacheSizeInKb = 3072; gtSysInfo->L3BankCount = 8; gtSysInfo->MaxFillRate = 16; @@ -131,7 +129,7 @@ void ICLLP_1x8x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable gtSysInfo->TotalDsThreads = 336; gtSysInfo->TotalGsThreads = 336; gtSysInfo->TotalPsThreadsWindowerRange = 64; - gtSysInfo->CsrSizeInMb = 8; + gtSysInfo->CsrSizeInMb = 5; gtSysInfo->MaxEuPerSubSlice = ICLLP::maxEuPerSubslice; gtSysInfo->MaxSlicesSupported = ICLLP::maxSlicesSupported; gtSysInfo->MaxSubSlicesSupported = ICLLP::maxSubslicesSupported; @@ -153,10 +151,8 @@ const HardwareInfo ICLLP_1x4x8::hwInfo = { GT_SYSTEM_INFO ICLLP_1x4x8::gtSystemInfo = {0}; void ICLLP_1x4x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 31; - gtSysInfo->ThreadCount = 31 * ICLLP::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * ICLLP::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 4; gtSysInfo->L3CacheSizeInKb = 2304; gtSysInfo->L3BankCount = 6; gtSysInfo->MaxFillRate = 8; @@ -167,8 +163,8 @@ void ICLLP_1x4x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable gtSysInfo->TotalPsThreadsWindowerRange = 128; gtSysInfo->CsrSizeInMb = 5; gtSysInfo->MaxEuPerSubSlice = ICLLP::maxEuPerSubslice; - gtSysInfo->MaxSlicesSupported = 1; - gtSysInfo->MaxSubSlicesSupported = 4; + gtSysInfo->MaxSlicesSupported = ICLLP::maxSlicesSupported; + gtSysInfo->MaxSubSlicesSupported = ICLLP::maxSubslicesSupported; gtSysInfo->IsL3HashModeEnabled = false; gtSysInfo->IsDynamicallyPopulated = false; if (setupFeatureTableAndWorkaroundTable) { @@ -186,10 +182,8 @@ const HardwareInfo ICLLP_1x6x8::hwInfo = { GT_SYSTEM_INFO ICLLP_1x6x8::gtSystemInfo = {0}; void ICLLP_1x6x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 47; - gtSysInfo->ThreadCount = 47 * ICLLP::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * ICLLP::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 6; gtSysInfo->L3CacheSizeInKb = 2304; gtSysInfo->L3BankCount = 6; gtSysInfo->MaxFillRate = 8; @@ -200,8 +194,8 @@ void ICLLP_1x6x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable gtSysInfo->TotalPsThreadsWindowerRange = 128; gtSysInfo->CsrSizeInMb = 5; gtSysInfo->MaxEuPerSubSlice = ICLLP::maxEuPerSubslice; - gtSysInfo->MaxSlicesSupported = 1; - gtSysInfo->MaxSubSlicesSupported = 4; + gtSysInfo->MaxSlicesSupported = ICLLP::maxSlicesSupported; + gtSysInfo->MaxSubSlicesSupported = ICLLP::maxSubslicesSupported; gtSysInfo->IsL3HashModeEnabled = false; gtSysInfo->IsDynamicallyPopulated = false; if (setupFeatureTableAndWorkaroundTable) { @@ -219,10 +213,8 @@ const HardwareInfo ICLLP_1x1x8::hwInfo = { GT_SYSTEM_INFO ICLLP_1x1x8::gtSystemInfo = {0}; void ICLLP_1x1x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 8; - gtSysInfo->ThreadCount = 8 * ICLLP::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * ICLLP::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 1; gtSysInfo->L3CacheSizeInKb = 2304; gtSysInfo->L3BankCount = 6; gtSysInfo->MaxFillRate = 8; @@ -233,8 +225,8 @@ void ICLLP_1x1x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable gtSysInfo->TotalPsThreadsWindowerRange = 128; gtSysInfo->CsrSizeInMb = 5; gtSysInfo->MaxEuPerSubSlice = ICLLP::maxEuPerSubslice; - gtSysInfo->MaxSlicesSupported = 1; - gtSysInfo->MaxSubSlicesSupported = 4; + gtSysInfo->MaxSlicesSupported = ICLLP::maxSlicesSupported; + gtSysInfo->MaxSubSlicesSupported = ICLLP::maxSubslicesSupported; gtSysInfo->IsL3HashModeEnabled = false; gtSysInfo->IsDynamicallyPopulated = false; if (setupFeatureTableAndWorkaroundTable) { @@ -243,6 +235,7 @@ void ICLLP_1x1x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable }; const HardwareInfo ICLLP::hwInfo = ICLLP_1x8x8::hwInfo; +const std::string ICLLP::defaultHardwareInfoConfig = "1x8x8"; void setupICLLPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig) { if (hwInfoConfig == "1x8x8") { diff --git a/runtime/gen11/hw_info_lkf.inl b/runtime/gen11/hw_info_lkf.inl index 0eda4636b4..fcc08d0ae1 100644 --- a/runtime/gen11/hw_info_lkf.inl +++ b/runtime/gen11/hw_info_lkf.inl @@ -117,10 +117,8 @@ const HardwareInfo LKF_1x8x8::hwInfo = { GT_SYSTEM_INFO LKF_1x8x8::gtSystemInfo = {0}; void LKF_1x8x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 64; - gtSysInfo->ThreadCount = 64 * LKF::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * LKF::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 8; gtSysInfo->L3CacheSizeInKb = 2560; gtSysInfo->L3BankCount = 8; gtSysInfo->MaxFillRate = 16; @@ -141,6 +139,7 @@ void LKF_1x8x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAn }; const HardwareInfo LKF::hwInfo = LKF_1x8x8::hwInfo; +const std::string LKF::defaultHardwareInfoConfig = "1x8x8"; void setupLKFHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig) { if (hwInfoConfig == "1x8x8") { diff --git a/runtime/gen12lp/hw_cmds_tgllp.h b/runtime/gen12lp/hw_cmds_tgllp.h index a5ded22b0e..b5737fdf4b 100644 --- a/runtime/gen12lp/hw_cmds_tgllp.h +++ b/runtime/gen12lp/hw_cmds_tgllp.h @@ -12,6 +12,7 @@ namespace NEO { struct TGLLP : public TGLLPFamily { static const PLATFORM platform; static const HardwareInfo hwInfo; + static const std::string defaultHardwareInfoConfig; static FeatureTable featureTable; static WorkaroundTable workaroundTable; static const uint32_t threadsPerEu = 7; diff --git a/runtime/gen12lp/hw_info_tgllp.inl b/runtime/gen12lp/hw_info_tgllp.inl index 5ca5c732c6..c97d9d44f9 100644 --- a/runtime/gen12lp/hw_info_tgllp.inl +++ b/runtime/gen12lp/hw_info_tgllp.inl @@ -116,10 +116,8 @@ const HardwareInfo TGLLP_1x6x16::hwInfo = { GT_SYSTEM_INFO TGLLP_1x6x16::gtSystemInfo = {0}; void TGLLP_1x6x16::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 96; - gtSysInfo->ThreadCount = 96 * TGLLP::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * TGLLP::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 6; gtSysInfo->DualSubSliceCount = 6; gtSysInfo->L3CacheSizeInKb = 3840; gtSysInfo->L3BankCount = 8; @@ -157,10 +155,8 @@ const HardwareInfo TGLLP_1x2x16::hwInfo = { GT_SYSTEM_INFO TGLLP_1x2x16::gtSystemInfo = {0}; void TGLLP_1x2x16::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 32; - gtSysInfo->ThreadCount = 32 * TGLLP::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * TGLLP::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 2; gtSysInfo->DualSubSliceCount = 2; gtSysInfo->L3CacheSizeInKb = 1920; gtSysInfo->L3BankCount = 4; @@ -188,6 +184,7 @@ void TGLLP_1x2x16::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTabl }; const HardwareInfo TGLLP::hwInfo = TGLLP_1x6x16::hwInfo; +const std::string TGLLP::defaultHardwareInfoConfig = "1x6x16"; void setupTGLLPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig) { if (hwInfoConfig == "1x6x16") { diff --git a/runtime/gen8/hw_cmds_bdw.h b/runtime/gen8/hw_cmds_bdw.h index 6c57c5baa4..354efe16e6 100644 --- a/runtime/gen8/hw_cmds_bdw.h +++ b/runtime/gen8/hw_cmds_bdw.h @@ -15,6 +15,7 @@ namespace NEO { struct BDW : public BDWFamily { static const PLATFORM platform; static const HardwareInfo hwInfo; + static const std::string defaultHardwareInfoConfig; static FeatureTable featureTable; static WorkaroundTable workaroundTable; static const uint32_t threadsPerEu = 7; diff --git a/runtime/gen8/hw_info_bdw.inl b/runtime/gen8/hw_info_bdw.inl index dbdfb28fb9..ac9222a4da 100644 --- a/runtime/gen8/hw_info_bdw.inl +++ b/runtime/gen8/hw_info_bdw.inl @@ -109,10 +109,8 @@ const HardwareInfo BDW_1x2x6::hwInfo = { GT_SYSTEM_INFO BDW_1x2x6::gtSystemInfo = {0}; void BDW_1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 12; - gtSysInfo->ThreadCount = 12 * BDW::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * BDW::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 2; gtSysInfo->L3CacheSizeInKb = 384; gtSysInfo->L3BankCount = 2; gtSysInfo->MaxFillRate = 8; @@ -142,10 +140,8 @@ const HardwareInfo BDW_1x3x6::hwInfo = { GT_SYSTEM_INFO BDW_1x3x6::gtSystemInfo = {0}; void BDW_1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 18; - gtSysInfo->ThreadCount = 18 * BDW::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * BDW::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 3; gtSysInfo->L3CacheSizeInKb = 768; gtSysInfo->L3BankCount = 4; gtSysInfo->MaxFillRate = 8; @@ -175,10 +171,8 @@ const HardwareInfo BDW_1x3x8::hwInfo = { GT_SYSTEM_INFO BDW_1x3x8::gtSystemInfo = {0}; void BDW_1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 23; - gtSysInfo->ThreadCount = 23 * BDW::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * BDW::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 3; gtSysInfo->L3CacheSizeInKb = 384; gtSysInfo->L3BankCount = 2; gtSysInfo->MaxFillRate = 8; @@ -208,10 +202,8 @@ const HardwareInfo BDW_2x3x8::hwInfo = { GT_SYSTEM_INFO BDW_2x3x8::gtSystemInfo = {0}; void BDW_2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 47; - gtSysInfo->ThreadCount = 47 * BDW::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * BDW::threadsPerEu; gtSysInfo->SliceCount = 2; - gtSysInfo->SubSliceCount = 6; gtSysInfo->L3CacheSizeInKb = 1536; gtSysInfo->L3BankCount = 8; gtSysInfo->MaxFillRate = 16; @@ -232,6 +224,7 @@ void BDW_2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAn }; const HardwareInfo BDW::hwInfo = BDW_1x3x8::hwInfo; +const std::string BDW::defaultHardwareInfoConfig = "1x3x8"; void setupBDWHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig) { if (hwInfoConfig == "2x3x8") { diff --git a/runtime/gen9/hw_cmds_bxt.h b/runtime/gen9/hw_cmds_bxt.h index fa53682fcf..7ed0e101b1 100644 --- a/runtime/gen9/hw_cmds_bxt.h +++ b/runtime/gen9/hw_cmds_bxt.h @@ -13,6 +13,7 @@ namespace NEO { struct BXT : public SKLFamily { static const PLATFORM platform; static const HardwareInfo hwInfo; + static const std::string defaultHardwareInfoConfig; static FeatureTable featureTable; static WorkaroundTable workaroundTable; static const uint32_t threadsPerEu = 6; diff --git a/runtime/gen9/hw_cmds_cfl.h b/runtime/gen9/hw_cmds_cfl.h index 4a29548ee1..7c6933bd30 100644 --- a/runtime/gen9/hw_cmds_cfl.h +++ b/runtime/gen9/hw_cmds_cfl.h @@ -13,6 +13,7 @@ namespace NEO { struct CFL : public SKLFamily { static const PLATFORM platform; static const HardwareInfo hwInfo; + static const std::string defaultHardwareInfoConfig; static FeatureTable featureTable; static WorkaroundTable workaroundTable; static const uint32_t threadsPerEu = 7; diff --git a/runtime/gen9/hw_cmds_glk.h b/runtime/gen9/hw_cmds_glk.h index c95f053c3a..fe4c9a84fd 100644 --- a/runtime/gen9/hw_cmds_glk.h +++ b/runtime/gen9/hw_cmds_glk.h @@ -13,6 +13,7 @@ namespace NEO { struct GLK : public SKLFamily { static const PLATFORM platform; static const HardwareInfo hwInfo; + static const std::string defaultHardwareInfoConfig; static FeatureTable featureTable; static WorkaroundTable workaroundTable; static const uint32_t threadsPerEu = 6; diff --git a/runtime/gen9/hw_cmds_kbl.h b/runtime/gen9/hw_cmds_kbl.h index a897a4a3b5..9796468352 100644 --- a/runtime/gen9/hw_cmds_kbl.h +++ b/runtime/gen9/hw_cmds_kbl.h @@ -13,6 +13,7 @@ namespace NEO { struct KBL : public SKLFamily { static const PLATFORM platform; static const HardwareInfo hwInfo; + static const std::string defaultHardwareInfoConfig; static FeatureTable featureTable; static WorkaroundTable workaroundTable; static const uint32_t threadsPerEu = 7; diff --git a/runtime/gen9/hw_cmds_skl.h b/runtime/gen9/hw_cmds_skl.h index ca5f2c6785..ddc2abf79e 100644 --- a/runtime/gen9/hw_cmds_skl.h +++ b/runtime/gen9/hw_cmds_skl.h @@ -13,6 +13,7 @@ namespace NEO { struct SKL : public SKLFamily { static const PLATFORM platform; static const HardwareInfo hwInfo; + static const std::string defaultHardwareInfoConfig; static FeatureTable featureTable; static WorkaroundTable workaroundTable; static const uint32_t threadsPerEu = 7; diff --git a/runtime/gen9/hw_info_bxt.inl b/runtime/gen9/hw_info_bxt.inl index 507ce3e20a..5ad9c24a86 100644 --- a/runtime/gen9/hw_info_bxt.inl +++ b/runtime/gen9/hw_info_bxt.inl @@ -126,10 +126,8 @@ const HardwareInfo BXT_1x2x6::hwInfo = { GT_SYSTEM_INFO BXT_1x2x6::gtSystemInfo = {0}; void BXT_1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 12; - gtSysInfo->ThreadCount = 12 * BXT::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * BXT::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 2; gtSysInfo->L3CacheSizeInKb = 384; gtSysInfo->L3BankCount = 1; gtSysInfo->MaxFillRate = 8; @@ -159,10 +157,8 @@ const HardwareInfo BXT_1x3x6::hwInfo = { GT_SYSTEM_INFO BXT_1x3x6::gtSystemInfo = {0}; void BXT_1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 18; - gtSysInfo->ThreadCount = 18 * BXT::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * BXT::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 3; gtSysInfo->L3CacheSizeInKb = 384; gtSysInfo->L3BankCount = 1; gtSysInfo->MaxFillRate = 8; @@ -183,6 +179,7 @@ void BXT_1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAn }; const HardwareInfo BXT::hwInfo = BXT_1x3x6::hwInfo; +const std::string BXT::defaultHardwareInfoConfig = "1x3x6"; void setupBXTHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig) { if (hwInfoConfig == "1x2x6") { diff --git a/runtime/gen9/hw_info_cfl.inl b/runtime/gen9/hw_info_cfl.inl index a322813ffc..f6de6825c4 100644 --- a/runtime/gen9/hw_info_cfl.inl +++ b/runtime/gen9/hw_info_cfl.inl @@ -114,10 +114,8 @@ const HardwareInfo CFL_1x2x6::hwInfo = { GT_SYSTEM_INFO CFL_1x2x6::gtSystemInfo = {0}; void CFL_1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 11; - gtSysInfo->ThreadCount = 11 * CFL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * CFL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 2; gtSysInfo->L3CacheSizeInKb = 384; gtSysInfo->L3BankCount = 2; gtSysInfo->MaxFillRate = 8; @@ -147,10 +145,8 @@ const HardwareInfo CFL_1x3x6::hwInfo = { GT_SYSTEM_INFO CFL_1x3x6::gtSystemInfo = {0}; void CFL_1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 17; - gtSysInfo->ThreadCount = 17 * CFL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * CFL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 3; gtSysInfo->L3CacheSizeInKb = 768; gtSysInfo->L3BankCount = 4; gtSysInfo->MaxFillRate = 8; @@ -180,10 +176,8 @@ const HardwareInfo CFL_1x3x8::hwInfo = { GT_SYSTEM_INFO CFL_1x3x8::gtSystemInfo = {0}; void CFL_1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 23; - gtSysInfo->ThreadCount = 23 * CFL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * CFL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 3; gtSysInfo->L3CacheSizeInKb = 768; gtSysInfo->L3BankCount = 4; gtSysInfo->MaxFillRate = 8; @@ -213,10 +207,8 @@ const HardwareInfo CFL_2x3x8::hwInfo = { GT_SYSTEM_INFO CFL_2x3x8::gtSystemInfo = {0}; void CFL_2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 47; - gtSysInfo->ThreadCount = 47 * CFL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * CFL::threadsPerEu; gtSysInfo->SliceCount = 2; - gtSysInfo->SubSliceCount = 6; gtSysInfo->L3CacheSizeInKb = 1536; gtSysInfo->L3BankCount = 8; gtSysInfo->MaxFillRate = 16; @@ -246,10 +238,8 @@ const HardwareInfo CFL_3x3x8::hwInfo = { GT_SYSTEM_INFO CFL_3x3x8::gtSystemInfo = {0}; void CFL_3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 71; - gtSysInfo->ThreadCount = 71 * CFL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * CFL::threadsPerEu; gtSysInfo->SliceCount = 3; - gtSysInfo->SubSliceCount = 9; gtSysInfo->L3CacheSizeInKb = 2304; gtSysInfo->L3BankCount = 12; gtSysInfo->MaxFillRate = 24; @@ -270,6 +260,7 @@ void CFL_3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAn }; const HardwareInfo CFL::hwInfo = CFL_1x3x6::hwInfo; +const std::string CFL::defaultHardwareInfoConfig = "1x3x6"; void setupCFLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig) { if (hwInfoConfig == "1x3x8") { diff --git a/runtime/gen9/hw_info_glk.inl b/runtime/gen9/hw_info_glk.inl index cafbaf04db..2a6a0be183 100644 --- a/runtime/gen9/hw_info_glk.inl +++ b/runtime/gen9/hw_info_glk.inl @@ -114,10 +114,8 @@ const HardwareInfo GLK_1x3x6::hwInfo = { GT_SYSTEM_INFO GLK_1x3x6::gtSystemInfo = {0}; void GLK_1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 18; - gtSysInfo->ThreadCount = 18 * GLK::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * GLK::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 3; gtSysInfo->L3CacheSizeInKb = 384; gtSysInfo->L3BankCount = 2; gtSysInfo->MaxFillRate = 8; @@ -147,10 +145,8 @@ const HardwareInfo GLK_1x2x6::hwInfo = { GT_SYSTEM_INFO GLK_1x2x6::gtSystemInfo = {0}; void GLK_1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 12; - gtSysInfo->ThreadCount = 12 * GLK::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * GLK::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 2; gtSysInfo->L3CacheSizeInKb = 384; gtSysInfo->L3BankCount = 2; gtSysInfo->MaxFillRate = 8; @@ -171,6 +167,7 @@ void GLK_1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAn }; const HardwareInfo GLK::hwInfo = GLK_1x3x6::hwInfo; +const std::string GLK::defaultHardwareInfoConfig = "1x3x6"; void setupGLKHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig) { if (hwInfoConfig == "1x2x6") { diff --git a/runtime/gen9/hw_info_kbl.inl b/runtime/gen9/hw_info_kbl.inl index ebd16dfaaf..9e2ebc1fee 100644 --- a/runtime/gen9/hw_info_kbl.inl +++ b/runtime/gen9/hw_info_kbl.inl @@ -123,10 +123,8 @@ const HardwareInfo KBL_1x2x6::hwInfo = { GT_SYSTEM_INFO KBL_1x2x6::gtSystemInfo = {0}; void KBL_1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 11; - gtSysInfo->ThreadCount = 11 * KBL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * KBL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 2; gtSysInfo->L3CacheSizeInKb = 384; gtSysInfo->L3BankCount = 2; gtSysInfo->MaxFillRate = 8; @@ -157,10 +155,8 @@ const HardwareInfo KBL_1x3x6::hwInfo = { GT_SYSTEM_INFO KBL_1x3x6::gtSystemInfo = {0}; void KBL_1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 17; - gtSysInfo->ThreadCount = 17 * KBL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * KBL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 3; gtSysInfo->L3CacheSizeInKb = 768; gtSysInfo->L3BankCount = 4; gtSysInfo->MaxFillRate = 8; @@ -190,10 +186,8 @@ const HardwareInfo KBL_1x3x8::hwInfo = { GT_SYSTEM_INFO KBL_1x3x8::gtSystemInfo = {0}; void KBL_1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 23; - gtSysInfo->ThreadCount = 23 * KBL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * KBL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 3; gtSysInfo->L3CacheSizeInKb = 768; gtSysInfo->L3BankCount = 4; gtSysInfo->MaxFillRate = 8; @@ -223,10 +217,8 @@ const HardwareInfo KBL_2x3x8::hwInfo = { GT_SYSTEM_INFO KBL_2x3x8::gtSystemInfo = {0}; void KBL_2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 47; - gtSysInfo->ThreadCount = 47 * KBL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * KBL::threadsPerEu; gtSysInfo->SliceCount = 2; - gtSysInfo->SubSliceCount = 6; gtSysInfo->L3CacheSizeInKb = 1536; gtSysInfo->L3BankCount = 8; gtSysInfo->MaxFillRate = 16; @@ -256,10 +248,8 @@ const HardwareInfo KBL_3x3x8::hwInfo = { GT_SYSTEM_INFO KBL_3x3x8::gtSystemInfo = {0}; void KBL_3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 71; - gtSysInfo->ThreadCount = 71 * KBL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * KBL::threadsPerEu; gtSysInfo->SliceCount = 3; - gtSysInfo->SubSliceCount = 9; gtSysInfo->L3CacheSizeInKb = 2304; gtSysInfo->L3BankCount = 12; gtSysInfo->MaxFillRate = 23; @@ -280,6 +270,7 @@ void KBL_3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAn }; const HardwareInfo KBL::hwInfo = KBL_1x3x6::hwInfo; +const std::string KBL::defaultHardwareInfoConfig = "1x3x6"; void setupKBLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig) { if (hwInfoConfig == "1x3x8") { diff --git a/runtime/gen9/hw_info_skl.inl b/runtime/gen9/hw_info_skl.inl index 5db4afc97a..ef7bb5fed4 100644 --- a/runtime/gen9/hw_info_skl.inl +++ b/runtime/gen9/hw_info_skl.inl @@ -136,10 +136,8 @@ const HardwareInfo SKL_1x2x6::hwInfo = { GT_SYSTEM_INFO SKL_1x2x6::gtSystemInfo = {0}; void SKL_1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 11; - gtSysInfo->ThreadCount = 11 * SKL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * SKL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 2; gtSysInfo->L3CacheSizeInKb = 384; gtSysInfo->L3BankCount = 2; gtSysInfo->MaxFillRate = 8; @@ -169,10 +167,8 @@ const HardwareInfo SKL_1x3x6::hwInfo = { GT_SYSTEM_INFO SKL_1x3x6::gtSystemInfo = {0}; void SKL_1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 17; - gtSysInfo->ThreadCount = 17 * SKL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * SKL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 3; gtSysInfo->L3CacheSizeInKb = 768; gtSysInfo->L3BankCount = 4; gtSysInfo->MaxFillRate = 8; @@ -202,10 +198,8 @@ const HardwareInfo SKL_1x3x8::hwInfo = { GT_SYSTEM_INFO SKL_1x3x8::gtSystemInfo = {0}; void SKL_1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 23; - gtSysInfo->ThreadCount = 23 * SKL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * SKL::threadsPerEu; gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 3; gtSysInfo->L3CacheSizeInKb = 768; gtSysInfo->L3BankCount = 4; gtSysInfo->MaxFillRate = 8; @@ -235,10 +229,8 @@ const HardwareInfo SKL_2x3x8::hwInfo = { GT_SYSTEM_INFO SKL_2x3x8::gtSystemInfo = {0}; void SKL_2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 47; - gtSysInfo->ThreadCount = 47 * SKL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * SKL::threadsPerEu; gtSysInfo->SliceCount = 2; - gtSysInfo->SubSliceCount = 6; gtSysInfo->L3CacheSizeInKb = 1536; gtSysInfo->L3BankCount = 8; gtSysInfo->MaxFillRate = 16; @@ -268,10 +260,8 @@ const HardwareInfo SKL_3x3x8::hwInfo = { GT_SYSTEM_INFO SKL_3x3x8::gtSystemInfo = {0}; void SKL_3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->EUCount = 71; - gtSysInfo->ThreadCount = 71 * SKL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * SKL::threadsPerEu; gtSysInfo->SliceCount = 3; - gtSysInfo->SubSliceCount = 9; gtSysInfo->L3CacheSizeInKb = 2304; gtSysInfo->L3BankCount = 12; gtSysInfo->MaxFillRate = 24; @@ -292,6 +282,7 @@ void SKL_3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAn }; const HardwareInfo SKL::hwInfo = SKL_1x3x8::hwInfo; +const std::string SKL::defaultHardwareInfoConfig = "1x3x8"; void setupSKLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig) { if (hwInfoConfig == "1x3x8") { diff --git a/runtime/helpers/enable_product.inl b/runtime/helpers/enable_product.inl index e2b164f437..99f64b137a 100644 --- a/runtime/helpers/enable_product.inl +++ b/runtime/helpers/enable_product.inl @@ -17,6 +17,7 @@ struct EnableGfxProductHw { EnableGfxFamilyHw(gfxFamily)> enableFamily; hardwarePrefix[gfxProduct] = HwMapper::abbreviation; + defaultHardwareInfoConfigTable[gfxProduct] = &GfxProduct::defaultHardwareInfoConfig; hardwareInfoTable[gfxProduct] = &GfxProduct::hwInfo; hardwareInfoSetup[gfxProduct] = GfxProduct::setupHardwareInfo; } diff --git a/runtime/helpers/hw_info.cpp b/runtime/helpers/hw_info.cpp index 15d0cd671b..7fc138ced9 100644 --- a/runtime/helpers/hw_info.cpp +++ b/runtime/helpers/hw_info.cpp @@ -22,6 +22,12 @@ HardwareInfo::HardwareInfo(const PLATFORM *platform, const FeatureTable *feature const char *hardwarePrefix[IGFX_MAX_PRODUCT] = { nullptr, }; + +// Global table of default hardware info configs +const std::string *defaultHardwareInfoConfigTable[IGFX_MAX_PRODUCT] = { + nullptr, +}; + // Global table of family names const char *familyName[IGFX_MAX_CORE] = { nullptr, @@ -52,6 +58,30 @@ bool getHwInfoForPlatformString(std::string &platform, const HardwareInfo *&hwIn return ret; } +bool setHwInfoValuesFromConfigString(const std::string &hwInfoConfig, HardwareInfo &hwInfoIn) { + size_t currPos = hwInfoConfig.find('x', 0); + if (currPos == std::string::npos) { + return false; + } + uint32_t sliceCount = static_cast(std::stoul(hwInfoConfig.substr(0, currPos))); + size_t prevPos = currPos + 1; + + currPos = hwInfoConfig.find('x', prevPos); + if (currPos == std::string::npos) { + return false; + } + uint32_t subSliceCount = sliceCount * static_cast(std::stoul(hwInfoConfig.substr(prevPos, currPos))); + prevPos = currPos + 1; + + uint32_t euCount = subSliceCount * static_cast(std::stoul(hwInfoConfig.substr(prevPos, std::string::npos))); + + hwInfoIn.gtSystemInfo.SliceCount = sliceCount; + hwInfoIn.gtSystemInfo.SubSliceCount = subSliceCount; + hwInfoIn.gtSystemInfo.EUCount = euCount; + + return true; +} + aub_stream::EngineType getChosenEngineType(const HardwareInfo &hwInfo) { return DebugManager.flags.NodeOrdinal.get() == -1 ? hwInfo.capabilityTable.defaultEngineType diff --git a/runtime/helpers/hw_info.h b/runtime/helpers/hw_info.h index 8fba297409..feb9755f3d 100644 --- a/runtime/helpers/hw_info.h +++ b/runtime/helpers/hw_info.h @@ -82,7 +82,8 @@ struct GfxFamilyMapper {}; // Global table of hardware prefixes extern bool familyEnabled[IGFX_MAX_CORE]; extern const char *familyName[IGFX_MAX_CORE]; -extern const char *hardwarePrefix[]; +extern const char *hardwarePrefix[IGFX_MAX_PRODUCT]; +extern const std::string *defaultHardwareInfoConfigTable[IGFX_MAX_PRODUCT]; extern const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT]; extern void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const std::string &hwInfoConfig); @@ -95,6 +96,7 @@ struct EnableGfxFamilyHw { }; bool getHwInfoForPlatformString(std::string &platform, const HardwareInfo *&hwInfoIn); +bool setHwInfoValuesFromConfigString(const std::string &hwInfoConfig, HardwareInfo &hwInfoIn); aub_stream::EngineType getChosenEngineType(const HardwareInfo &hwInfo); const std::string getFamilyNameWithType(const HardwareInfo &hwInfo); } // namespace NEO diff --git a/runtime/os_interface/device_factory.cpp b/runtime/os_interface/device_factory.cpp index 20752d689a..6426c721d2 100644 --- a/runtime/os_interface/device_factory.cpp +++ b/runtime/os_interface/device_factory.cpp @@ -33,6 +33,14 @@ bool DeviceFactory::getDevicesForProductFamilyOverride(size_t &numDevices, Execu auto hardwareInfo = executionEnvironment.getMutableHardwareInfo(); *hardwareInfo = *hwInfoConst; + if (hwInfoConfig == "default") { + hwInfoConfig = *defaultHardwareInfoConfigTable[hwInfoConst->platform.eProductFamily]; + } + + if (!setHwInfoValuesFromConfigString(hwInfoConfig, *hardwareInfo)) { + return false; + } + hardwareInfoSetup[hwInfoConst->platform.eProductFamily](hardwareInfo, true, hwInfoConfig); HwInfoConfig *hwConfig = HwInfoConfig::get(hardwareInfo->platform.eProductFamily); diff --git a/runtime/os_interface/linux/drm_neo.cpp b/runtime/os_interface/linux/drm_neo.cpp index 9973f36aa6..5e76a20577 100644 --- a/runtime/os_interface/linux/drm_neo.cpp +++ b/runtime/os_interface/linux/drm_neo.cpp @@ -9,6 +9,7 @@ #include "core/memory_manager/memory_constants.h" #include "core/utilities/directory.h" +#include "runtime/helpers/hw_info.h" #include "runtime/os_interface/os_inc_base.h" #include @@ -205,4 +206,28 @@ int Drm::getErrno() { return errno; } +int Drm::setupHardwareInfo(DeviceDescriptor *device, bool setupFeatureTableAndWorkaroundTable) { + HardwareInfo *hwInfo = const_cast(device->pHwInfo); + int ret; + int euTotal; + int subsliceTotal; + + ret = getEuTotal(euTotal); + if (ret != 0) { + printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "FATAL: Cannot query EU total parameter!\n"); + return ret; + } + + ret = getSubsliceTotal(subsliceTotal); + if (ret != 0) { + printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "FATAL: Cannot query subslice total parameter!\n"); + return ret; + } + + hwInfo->gtSystemInfo.EUCount = static_cast(euTotal); + hwInfo->gtSystemInfo.SubSliceCount = static_cast(subsliceTotal); + device->setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + return 0; +} + } // namespace NEO diff --git a/runtime/os_interface/linux/drm_neo.h b/runtime/os_interface/linux/drm_neo.h index cb4f6a786f..ba101a559d 100644 --- a/runtime/os_interface/linux/drm_neo.h +++ b/runtime/os_interface/linux/drm_neo.h @@ -77,6 +77,7 @@ class Drm { uint64_t getSliceMask(uint64_t sliceCount); bool queryEngineInfo(); bool queryMemoryInfo(); + int setupHardwareInfo(DeviceDescriptor *, bool); MemoryInfo *getMemoryInfo() const { return memoryInfo.get(); diff --git a/unit_tests/gen11/ehl/linux/hw_info_config_tests_ehl.cpp b/unit_tests/gen11/ehl/linux/hw_info_config_tests_ehl.cpp index 96f416c4a1..8378974d05 100644 --- a/unit_tests/gen11/ehl/linux/hw_info_config_tests_ehl.cpp +++ b/unit_tests/gen11/ehl/linux/hw_info_config_tests_ehl.cpp @@ -71,10 +71,13 @@ typedef ::testing::Types ehlTestTypes; TYPED_TEST_CASE(EhlHwInfoTests, ehlTestTypes); TYPED_TEST(EhlHwInfoTests, gtSetupIsCorrect) { HardwareInfo hwInfo; + DrmMock drm; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - gtSystemInfo = {}; + DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1}; - TypeParam::setupHardwareInfo(&hwInfo, false); + int ret = drm.setupHardwareInfo(&device, false); + + EXPECT_EQ(ret, 0); EXPECT_GT(gtSystemInfo.EUCount, 0u); EXPECT_GT(gtSystemInfo.ThreadCount, 0u); EXPECT_GT(gtSystemInfo.SliceCount, 0u); diff --git a/unit_tests/gen11/ehl/test_hw_info_config_ehl.cpp b/unit_tests/gen11/ehl/test_hw_info_config_ehl.cpp index bb7af15fb9..9741165c4d 100644 --- a/unit_tests/gen11/ehl/test_hw_info_config_ehl.cpp +++ b/unit_tests/gen11/ehl/test_hw_info_config_ehl.cpp @@ -9,41 +9,14 @@ using namespace NEO; -TEST(EhlHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorrect) { +TEST(EhlHwInfoConfig, givenHwInfoErrorneousConfigString) { if (IGFX_ELKHARTLAKE != productFamily) { return; } HardwareInfo hwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - std::string strConfig = "1x4x8"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(4u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(32u, gtSystemInfo.EUCount); - - strConfig = "1x4x4"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(4u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(16u, gtSystemInfo.EUCount); - - strConfig = "1x2x4"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(2u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(8u, gtSystemInfo.EUCount); - - strConfig = "default"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(4u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(32u, gtSystemInfo.EUCount); - - strConfig = "erroneous"; + std::string strConfig = "erroneous"; gtSystemInfo = {0}; EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, strConfig)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); diff --git a/unit_tests/gen11/icllp/linux/hw_info_config_tests_icllp.cpp b/unit_tests/gen11/icllp/linux/hw_info_config_tests_icllp.cpp index a7c4393080..fc1896f2fb 100644 --- a/unit_tests/gen11/icllp/linux/hw_info_config_tests_icllp.cpp +++ b/unit_tests/gen11/icllp/linux/hw_info_config_tests_icllp.cpp @@ -9,7 +9,6 @@ #include "unit_tests/os_interface/linux/hw_info_config_linux_tests.h" using namespace NEO; -using namespace std; struct HwInfoConfigTestLinuxIcllp : HwInfoConfigTestLinux { void SetUp() override { @@ -20,7 +19,7 @@ struct HwInfoConfigTestLinuxIcllp : HwInfoConfigTestLinux { } }; -ICLLPTEST_F(HwInfoConfigTestLinuxIcllp, configureHwInfo) { +ICLLPTEST_F(HwInfoConfigTestLinuxIcllp, configureHwInfoIcllp) { auto hwInfoConfig = HwInfoConfig::get(productFamily); int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface); EXPECT_EQ(0, ret); @@ -66,120 +65,24 @@ ICLLPTEST_F(HwInfoConfigTestLinuxIcllp, negative) { EXPECT_EQ(-1, ret); } -using IcllpHwInfoTests = ::testing::Test; - -ICLLPTEST_F(IcllpHwInfoTests, icllp1x8x8systemInfo) { - GT_SYSTEM_INFO expectedGtSystemInfo = {}; +template +class IcllpHwInfoTests : public ::testing::Test {}; +typedef ::testing::Types icllpTestTypes; +TYPED_TEST_CASE(IcllpHwInfoTests, icllpTestTypes); +TYPED_TEST(IcllpHwInfoTests, gtSetupIsCorrect) { HardwareInfo hwInfo; - GT_SYSTEM_INFO &requestedGtSystemInfo = hwInfo.gtSystemInfo; - requestedGtSystemInfo = {}; + DrmMock drm; + GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; + DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1}; - expectedGtSystemInfo.EUCount = 63; - expectedGtSystemInfo.ThreadCount = 63 * ICLLP::threadsPerEu; - expectedGtSystemInfo.SliceCount = 1; - expectedGtSystemInfo.SubSliceCount = 8; - expectedGtSystemInfo.L3CacheSizeInKb = 3072; - expectedGtSystemInfo.L3BankCount = 8; - expectedGtSystemInfo.MaxFillRate = 16; - expectedGtSystemInfo.TotalVsThreads = 336; - expectedGtSystemInfo.TotalHsThreads = 336; - expectedGtSystemInfo.TotalDsThreads = 336; - expectedGtSystemInfo.TotalGsThreads = 336; - expectedGtSystemInfo.TotalPsThreadsWindowerRange = 64; - expectedGtSystemInfo.CsrSizeInMb = 8; - expectedGtSystemInfo.MaxEuPerSubSlice = ICLLP::maxEuPerSubslice; - expectedGtSystemInfo.MaxSlicesSupported = ICLLP::maxSlicesSupported; - expectedGtSystemInfo.MaxSubSlicesSupported = ICLLP::maxSubslicesSupported; - expectedGtSystemInfo.IsL3HashModeEnabled = false; - expectedGtSystemInfo.IsDynamicallyPopulated = false; + int ret = drm.setupHardwareInfo(&device, false); - ICLLP_1x8x8::setupHardwareInfo(&hwInfo, false); - EXPECT_TRUE(memcmp(&requestedGtSystemInfo, &expectedGtSystemInfo, sizeof(GT_SYSTEM_INFO)) == 0); -} - -ICLLPTEST_F(IcllpHwInfoTests, icllp1x4x8systemInfo) { - HardwareInfo hwInfo; - GT_SYSTEM_INFO expectedGtSystemInfo = {}; - GT_SYSTEM_INFO &requestedGtSystemInfo = hwInfo.gtSystemInfo; - requestedGtSystemInfo = {}; - - expectedGtSystemInfo.EUCount = 31; - expectedGtSystemInfo.ThreadCount = 31 * ICLLP::threadsPerEu; - expectedGtSystemInfo.SliceCount = 1; - expectedGtSystemInfo.SubSliceCount = 4; - expectedGtSystemInfo.L3CacheSizeInKb = 2304; - expectedGtSystemInfo.L3BankCount = 6; - expectedGtSystemInfo.MaxFillRate = 8; - expectedGtSystemInfo.TotalVsThreads = 364; - expectedGtSystemInfo.TotalHsThreads = 224; - expectedGtSystemInfo.TotalDsThreads = 364; - expectedGtSystemInfo.TotalGsThreads = 224; - expectedGtSystemInfo.TotalPsThreadsWindowerRange = 128; - expectedGtSystemInfo.CsrSizeInMb = 5; - expectedGtSystemInfo.MaxEuPerSubSlice = ICLLP::maxEuPerSubslice; - expectedGtSystemInfo.MaxSlicesSupported = 1; - expectedGtSystemInfo.MaxSubSlicesSupported = 4; - expectedGtSystemInfo.IsL3HashModeEnabled = false; - expectedGtSystemInfo.IsDynamicallyPopulated = false; - - ICLLP_1x4x8::setupHardwareInfo(&hwInfo, false); - EXPECT_TRUE(memcmp(&requestedGtSystemInfo, &expectedGtSystemInfo, sizeof(GT_SYSTEM_INFO)) == 0); -} - -ICLLPTEST_F(IcllpHwInfoTests, icllp1x6x8systemInfo) { - GT_SYSTEM_INFO expectedGtSystemInfo = {}; - HardwareInfo hwInfo; - GT_SYSTEM_INFO &requestedGtSystemInfo = hwInfo.gtSystemInfo; - requestedGtSystemInfo = {}; - - expectedGtSystemInfo.EUCount = 47; - expectedGtSystemInfo.ThreadCount = 47 * ICLLP::threadsPerEu; - expectedGtSystemInfo.SliceCount = 1; - expectedGtSystemInfo.SubSliceCount = 6; - expectedGtSystemInfo.L3CacheSizeInKb = 2304; - expectedGtSystemInfo.L3BankCount = 6; - expectedGtSystemInfo.MaxFillRate = 8; - expectedGtSystemInfo.TotalVsThreads = 364; - expectedGtSystemInfo.TotalHsThreads = 224; - expectedGtSystemInfo.TotalDsThreads = 364; - expectedGtSystemInfo.TotalGsThreads = 224; - expectedGtSystemInfo.TotalPsThreadsWindowerRange = 128; - expectedGtSystemInfo.CsrSizeInMb = 5; - expectedGtSystemInfo.MaxEuPerSubSlice = ICLLP::maxEuPerSubslice; - expectedGtSystemInfo.MaxSlicesSupported = 1; - expectedGtSystemInfo.MaxSubSlicesSupported = 4; - expectedGtSystemInfo.IsL3HashModeEnabled = false; - expectedGtSystemInfo.IsDynamicallyPopulated = false; - - ICLLP_1x6x8::setupHardwareInfo(&hwInfo, false); - EXPECT_TRUE(memcmp(&requestedGtSystemInfo, &expectedGtSystemInfo, sizeof(GT_SYSTEM_INFO)) == 0); -} - -ICLLPTEST_F(IcllpHwInfoTests, icllp1x1x8systemInfo) { - GT_SYSTEM_INFO expectedGtSystemInfo = {}; - HardwareInfo hwInfo; - GT_SYSTEM_INFO &requestedGtSystemInfo = hwInfo.gtSystemInfo; - requestedGtSystemInfo = {}; - - expectedGtSystemInfo.EUCount = 8; - expectedGtSystemInfo.ThreadCount = 8 * ICLLP::threadsPerEu; - expectedGtSystemInfo.SliceCount = 1; - expectedGtSystemInfo.SubSliceCount = 1; - expectedGtSystemInfo.L3CacheSizeInKb = 2304; - expectedGtSystemInfo.L3BankCount = 6; - expectedGtSystemInfo.MaxFillRate = 8; - expectedGtSystemInfo.TotalVsThreads = 364; - expectedGtSystemInfo.TotalHsThreads = 224; - expectedGtSystemInfo.TotalDsThreads = 364; - expectedGtSystemInfo.TotalGsThreads = 224; - expectedGtSystemInfo.TotalPsThreadsWindowerRange = 128; - expectedGtSystemInfo.CsrSizeInMb = 5; - expectedGtSystemInfo.MaxEuPerSubSlice = ICLLP::maxEuPerSubslice; - expectedGtSystemInfo.MaxSlicesSupported = 1; - expectedGtSystemInfo.MaxSubSlicesSupported = 4; - expectedGtSystemInfo.IsL3HashModeEnabled = false; - expectedGtSystemInfo.IsDynamicallyPopulated = false; - - ICLLP_1x1x8::setupHardwareInfo(&hwInfo, false); - EXPECT_TRUE(memcmp(&requestedGtSystemInfo, &expectedGtSystemInfo, sizeof(GT_SYSTEM_INFO)) == 0); + EXPECT_EQ(ret, 0); + EXPECT_GT(gtSystemInfo.EUCount, 0u); + EXPECT_GT(gtSystemInfo.ThreadCount, 0u); + EXPECT_GT(gtSystemInfo.SliceCount, 0u); + EXPECT_GT(gtSystemInfo.SubSliceCount, 0u); + EXPECT_GT_VAL(gtSystemInfo.L3CacheSizeInKb, 0u); + EXPECT_EQ(gtSystemInfo.CsrSizeInMb, 5u); + EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); } diff --git a/unit_tests/gen11/icllp/test_hw_info_config_icllp.cpp b/unit_tests/gen11/icllp/test_hw_info_config_icllp.cpp index 40079ab3aa..0eb16bf432 100644 --- a/unit_tests/gen11/icllp/test_hw_info_config_icllp.cpp +++ b/unit_tests/gen11/icllp/test_hw_info_config_icllp.cpp @@ -9,7 +9,7 @@ using namespace NEO; -TEST(IcllpHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorrect) { +TEST(IcllpHwInfoConfig, givenHwInfoErrorneousConfigString) { if (IGFX_ICELAKE_LP != productFamily) { return; } @@ -17,41 +17,7 @@ TEST(IcllpHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCo GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; gtSystemInfo = {0}; - std::string strConfig = "1x8x8"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(8u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(63u, gtSystemInfo.EUCount); - - strConfig = "1x4x8"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(4u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(31u, gtSystemInfo.EUCount); - - strConfig = "1x6x8"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(6u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(47u, gtSystemInfo.EUCount); - - strConfig = "1x1x8"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(1u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(8u, gtSystemInfo.EUCount); - - strConfig = "default"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(8u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(63u, gtSystemInfo.EUCount); - - strConfig = "erroneous"; + std::string strConfig = "erroneous"; gtSystemInfo = {0}; EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, strConfig)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); diff --git a/unit_tests/gen11/lkf/linux/hw_info_config_tests_lkf.cpp b/unit_tests/gen11/lkf/linux/hw_info_config_tests_lkf.cpp index 9a9b91cad8..301fc8e861 100644 --- a/unit_tests/gen11/lkf/linux/hw_info_config_tests_lkf.cpp +++ b/unit_tests/gen11/lkf/linux/hw_info_config_tests_lkf.cpp @@ -71,9 +71,13 @@ typedef ::testing::Types lkfTestTypes; TYPED_TEST_CASE(LkfHwInfoTests, lkfTestTypes); TYPED_TEST(LkfHwInfoTests, gtSetupIsCorrect) { HardwareInfo hwInfo; + DrmMock drm; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; + DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1}; - TypeParam::setupHardwareInfo(&hwInfo, false); + int ret = drm.setupHardwareInfo(&device, false); + + EXPECT_EQ(ret, 0); EXPECT_GT(gtSystemInfo.EUCount, 0u); EXPECT_GT(gtSystemInfo.ThreadCount, 0u); EXPECT_GT(gtSystemInfo.SliceCount, 0u); diff --git a/unit_tests/gen11/lkf/test_hw_info_config_lkf.cpp b/unit_tests/gen11/lkf/test_hw_info_config_lkf.cpp index 1e99f01059..17795b7ee1 100644 --- a/unit_tests/gen11/lkf/test_hw_info_config_lkf.cpp +++ b/unit_tests/gen11/lkf/test_hw_info_config_lkf.cpp @@ -9,27 +9,14 @@ using namespace NEO; -TEST(LkfHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorrect) { +TEST(LkfHwInfoConfig, givenHwInfoErrorneousConfigString) { if (IGFX_LAKEFIELD != productFamily) { return; } HardwareInfo hwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - std::string strConfig = "1x8x8"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(8u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(64u, gtSystemInfo.EUCount); - - strConfig = "default"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(8u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(64u, gtSystemInfo.EUCount); - - strConfig = "erroneous"; + std::string strConfig = "erroneous"; gtSystemInfo = {0}; EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, strConfig)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); diff --git a/unit_tests/gen12lp/tgllp/test_hw_info_config_tgllp.cpp b/unit_tests/gen12lp/tgllp/test_hw_info_config_tgllp.cpp index c76e99c96c..02643f45f4 100644 --- a/unit_tests/gen12lp/tgllp/test_hw_info_config_tgllp.cpp +++ b/unit_tests/gen12lp/tgllp/test_hw_info_config_tgllp.cpp @@ -9,33 +9,14 @@ using namespace NEO; -TEST(TgllpHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorrect) { +TEST(TgllpHwInfoConfig, givenHwInfoErrorneousConfigString) { if (IGFX_TIGERLAKE_LP != productFamily) { return; } HardwareInfo hwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - std::string strConfig = "1x6x16"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(6u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(96u, gtSystemInfo.EUCount); - - strConfig = "1x2x16"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(2u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(32u, gtSystemInfo.EUCount); - - strConfig = "default"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(6u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(96u, gtSystemInfo.EUCount); - - strConfig = "erroneous"; + std::string strConfig = "erroneous"; gtSystemInfo = {0}; EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, strConfig)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); diff --git a/unit_tests/gen8/bdw/linux/hw_info_config_tests_bdw.cpp b/unit_tests/gen8/bdw/linux/hw_info_config_tests_bdw.cpp index cdcc0b8490..ab7d85d123 100644 --- a/unit_tests/gen8/bdw/linux/hw_info_config_tests_bdw.cpp +++ b/unit_tests/gen8/bdw/linux/hw_info_config_tests_bdw.cpp @@ -165,9 +165,13 @@ typedef ::testing::Types bdwTestType TYPED_TEST_CASE(BdwHwInfoTests, bdwTestTypes); TYPED_TEST(BdwHwInfoTests, gtSetupIsCorrect) { HardwareInfo hwInfo; + DrmMock drm; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; + DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1}; - TypeParam::setupHardwareInfo(&hwInfo, false); + int ret = drm.setupHardwareInfo(&device, false); + + EXPECT_EQ(ret, 0); EXPECT_GT(gtSystemInfo.EUCount, 0u); EXPECT_GT(gtSystemInfo.ThreadCount, 0u); EXPECT_GT(gtSystemInfo.SliceCount, 0u); diff --git a/unit_tests/gen8/bdw/test_hw_info_config_bdw.cpp b/unit_tests/gen8/bdw/test_hw_info_config_bdw.cpp index 05b996229a..5d87563107 100644 --- a/unit_tests/gen8/bdw/test_hw_info_config_bdw.cpp +++ b/unit_tests/gen8/bdw/test_hw_info_config_bdw.cpp @@ -9,51 +9,16 @@ using namespace NEO; -TEST(BdwHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorrect) { +TEST(BdwHwInfoConfig, givenHwInfoErrorneousConfigString) { if (IGFX_BROADWELL != productFamily) { return; } HardwareInfo hwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - std::string strConfig = "1x3x8"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(23u, gtSystemInfo.EUCount); - - strConfig = "2x3x8"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(2u, gtSystemInfo.SliceCount); - EXPECT_EQ(6u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(47u, gtSystemInfo.EUCount); - - strConfig = "1x2x6"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(2u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(12u, gtSystemInfo.EUCount); - - strConfig = "1x3x6"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(18u, gtSystemInfo.EUCount); - - strConfig = "default"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(23u, gtSystemInfo.EUCount); - - strConfig = "erroneous"; + std::string strConfig = "erroneous"; gtSystemInfo = {0}; EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, strConfig)); - EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.EUCount); diff --git a/unit_tests/gen9/bxt/linux/hw_info_config_tests.cpp b/unit_tests/gen9/bxt/linux/hw_info_config_tests.cpp index 021149a3eb..48e99386be 100644 --- a/unit_tests/gen9/bxt/linux/hw_info_config_tests.cpp +++ b/unit_tests/gen9/bxt/linux/hw_info_config_tests.cpp @@ -232,9 +232,13 @@ typedef ::testing::Types bxtTestTypes; TYPED_TEST_CASE(BxtHwInfoTests, bxtTestTypes); TYPED_TEST(BxtHwInfoTests, gtSetupIsCorrect) { HardwareInfo hwInfo; + DrmMock drm; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; + DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1}; - TypeParam::setupHardwareInfo(&hwInfo, false); + int ret = drm.setupHardwareInfo(&device, false); + + EXPECT_EQ(ret, 0); EXPECT_GT(gtSystemInfo.EUCount, 0u); EXPECT_GT(gtSystemInfo.ThreadCount, 0u); EXPECT_GT(gtSystemInfo.SliceCount, 0u); diff --git a/unit_tests/gen9/bxt/test_hw_info_config_bxt.cpp b/unit_tests/gen9/bxt/test_hw_info_config_bxt.cpp index ddeff5ac9b..51011a851f 100644 --- a/unit_tests/gen9/bxt/test_hw_info_config_bxt.cpp +++ b/unit_tests/gen9/bxt/test_hw_info_config_bxt.cpp @@ -9,34 +9,14 @@ using namespace NEO; -TEST(BxtHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorrect) { +TEST(BxtHwInfoConfig, givenHwInfoErrorneousConfigString) { if (IGFX_BROXTON != productFamily) { return; } HardwareInfo hwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - std::string strConfig = "1x2x6"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(2u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(12u, gtSystemInfo.EUCount); - - strConfig = "1x3x6"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(18u, gtSystemInfo.EUCount); - - strConfig = "default"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(18u, gtSystemInfo.EUCount); - - strConfig = "erroneous"; + std::string strConfig = "erroneous"; gtSystemInfo = {0}; EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, strConfig)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); diff --git a/unit_tests/gen9/cfl/linux/hw_info_config_tests_cfl.cpp b/unit_tests/gen9/cfl/linux/hw_info_config_tests_cfl.cpp index a6682fce5c..f7d2183fcf 100644 --- a/unit_tests/gen9/cfl/linux/hw_info_config_tests_cfl.cpp +++ b/unit_tests/gen9/cfl/linux/hw_info_config_tests_cfl.cpp @@ -177,9 +177,13 @@ typedef ::testing::Types TYPED_TEST_CASE(CflHwInfoTests, cflTestTypes); TYPED_TEST(CflHwInfoTests, gtSetupIsCorrect) { HardwareInfo hwInfo; + DrmMock drm; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; + DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1}; - TypeParam::setupHardwareInfo(&hwInfo, false); + int ret = drm.setupHardwareInfo(&device, false); + + EXPECT_EQ(ret, 0); EXPECT_GT(gtSystemInfo.EUCount, 0u); EXPECT_GT(gtSystemInfo.ThreadCount, 0u); EXPECT_GT(gtSystemInfo.SliceCount, 0u); diff --git a/unit_tests/gen9/cfl/test_hw_info_config_cfl.cpp b/unit_tests/gen9/cfl/test_hw_info_config_cfl.cpp index d1fbc3042e..1bd18590cc 100644 --- a/unit_tests/gen9/cfl/test_hw_info_config_cfl.cpp +++ b/unit_tests/gen9/cfl/test_hw_info_config_cfl.cpp @@ -9,55 +9,14 @@ using namespace NEO; -TEST(CflHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorrect) { +TEST(CflHwInfoConfig, givenHwInfoErrorneousConfigString) { if (IGFX_COFFEELAKE != productFamily) { return; } HardwareInfo hwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - std::string strConfig = "1x3x8"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(23u, gtSystemInfo.EUCount); - - strConfig = "2x3x8"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(2u, gtSystemInfo.SliceCount); - EXPECT_EQ(6u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(47u, gtSystemInfo.EUCount); - - strConfig = "3x3x8"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(3u, gtSystemInfo.SliceCount); - EXPECT_EQ(9u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(71u, gtSystemInfo.EUCount); - - strConfig = "1x2x6"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(2u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(11u, gtSystemInfo.EUCount); - - strConfig = "1x3x6"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(17u, gtSystemInfo.EUCount); - - strConfig = "default"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(17u, gtSystemInfo.EUCount); - - strConfig = "erroneous"; + std::string strConfig = "erroneous"; gtSystemInfo = {0}; EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, strConfig)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); diff --git a/unit_tests/gen9/glk/linux/hw_info_config_tests_glk.cpp b/unit_tests/gen9/glk/linux/hw_info_config_tests_glk.cpp index c02661d239..0447a9a0db 100644 --- a/unit_tests/gen9/glk/linux/hw_info_config_tests_glk.cpp +++ b/unit_tests/gen9/glk/linux/hw_info_config_tests_glk.cpp @@ -216,9 +216,13 @@ typedef ::testing::Types glkTestTypes; TYPED_TEST_CASE(GlkHwInfoTests, glkTestTypes); TYPED_TEST(GlkHwInfoTests, gtSetupIsCorrect) { HardwareInfo hwInfo; + DrmMock drm; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; + DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1}; - TypeParam::setupHardwareInfo(&hwInfo, false); + int ret = drm.setupHardwareInfo(&device, false); + + EXPECT_EQ(ret, 0); EXPECT_GT(gtSystemInfo.EUCount, 0u); EXPECT_GT(gtSystemInfo.ThreadCount, 0u); EXPECT_GT(gtSystemInfo.SliceCount, 0u); diff --git a/unit_tests/gen9/glk/test_hw_info_config_glk.cpp b/unit_tests/gen9/glk/test_hw_info_config_glk.cpp index d517a17d9c..b8de93d151 100644 --- a/unit_tests/gen9/glk/test_hw_info_config_glk.cpp +++ b/unit_tests/gen9/glk/test_hw_info_config_glk.cpp @@ -9,7 +9,7 @@ using namespace NEO; -TEST(GlkHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorrect) { +TEST(GlkHwInfoConfig, givenHwInfoErrorneousConfigString) { if (IGFX_GEMINILAKE != productFamily) { return; } @@ -17,27 +17,7 @@ TEST(GlkHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorr GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; gtSystemInfo = {0}; - std::string strConfig = "1x2x6"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(2u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(12u, gtSystemInfo.EUCount); - - strConfig = "1x3x6"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(18u, gtSystemInfo.EUCount); - - strConfig = "default"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(18u, gtSystemInfo.EUCount); - - strConfig = "erroneous"; + std::string strConfig = "erroneous"; gtSystemInfo = {0}; EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, strConfig)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); diff --git a/unit_tests/gen9/kbl/linux/hw_info_config_tests_kbl.cpp b/unit_tests/gen9/kbl/linux/hw_info_config_tests_kbl.cpp index 967dd7eb27..911471fb8b 100644 --- a/unit_tests/gen9/kbl/linux/hw_info_config_tests_kbl.cpp +++ b/unit_tests/gen9/kbl/linux/hw_info_config_tests_kbl.cpp @@ -232,9 +232,13 @@ typedef ::testing::Types TYPED_TEST_CASE(KblHwInfoTests, kblTestTypes); TYPED_TEST(KblHwInfoTests, gtSetupIsCorrect) { HardwareInfo hwInfo; + DrmMock drm; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; + DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1}; - TypeParam::setupHardwareInfo(&hwInfo, false); + int ret = drm.setupHardwareInfo(&device, false); + + EXPECT_EQ(ret, 0); EXPECT_GT(gtSystemInfo.EUCount, 0u); EXPECT_GT(gtSystemInfo.ThreadCount, 0u); EXPECT_GT(gtSystemInfo.SliceCount, 0u); diff --git a/unit_tests/gen9/kbl/test_hw_info_config_kbl.cpp b/unit_tests/gen9/kbl/test_hw_info_config_kbl.cpp index 79690c69ba..98bd33effa 100644 --- a/unit_tests/gen9/kbl/test_hw_info_config_kbl.cpp +++ b/unit_tests/gen9/kbl/test_hw_info_config_kbl.cpp @@ -9,55 +9,14 @@ using namespace NEO; -TEST(KblHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorrect) { +TEST(KblHwInfoConfig, givenHwInfoErrorneousConfigString) { if (IGFX_KABYLAKE != productFamily) { return; } HardwareInfo hwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - std::string strConfig = "1x3x8"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(23u, gtSystemInfo.EUCount); - - strConfig = "2x3x8"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(2u, gtSystemInfo.SliceCount); - EXPECT_EQ(6u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(47u, gtSystemInfo.EUCount); - - strConfig = "3x3x8"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(3u, gtSystemInfo.SliceCount); - EXPECT_EQ(9u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(71u, gtSystemInfo.EUCount); - - strConfig = "1x2x6"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(2u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(11u, gtSystemInfo.EUCount); - - strConfig = "1x3x6"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(17u, gtSystemInfo.EUCount); - - strConfig = "default"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(17u, gtSystemInfo.EUCount); - - strConfig = "erroneous"; + std::string strConfig = "erroneous"; gtSystemInfo = {0}; EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, strConfig)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); diff --git a/unit_tests/gen9/skl/linux/hw_info_config_tests_skl.cpp b/unit_tests/gen9/skl/linux/hw_info_config_tests_skl.cpp index b50abf9105..5d4ef45fdd 100644 --- a/unit_tests/gen9/skl/linux/hw_info_config_tests_skl.cpp +++ b/unit_tests/gen9/skl/linux/hw_info_config_tests_skl.cpp @@ -258,9 +258,13 @@ typedef ::testing::Types TYPED_TEST_CASE(SklHwInfoTests, sklTestTypes); TYPED_TEST(SklHwInfoTests, gtSetupIsCorrect) { HardwareInfo hwInfo; + DrmMock drm; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; + DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1}; - TypeParam::setupHardwareInfo(&hwInfo, false); + int ret = drm.setupHardwareInfo(&device, false); + + EXPECT_EQ(ret, 0); EXPECT_GT(gtSystemInfo.EUCount, 0u); EXPECT_GT(gtSystemInfo.ThreadCount, 0u); EXPECT_GT(gtSystemInfo.SliceCount, 0u); diff --git a/unit_tests/gen9/skl/test_hw_info_config_skl.cpp b/unit_tests/gen9/skl/test_hw_info_config_skl.cpp index 3843d6ca4b..f73aaaf1c0 100644 --- a/unit_tests/gen9/skl/test_hw_info_config_skl.cpp +++ b/unit_tests/gen9/skl/test_hw_info_config_skl.cpp @@ -9,7 +9,7 @@ using namespace NEO; -TEST(SklHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorrect) { +TEST(SklHwInfoConfig, givenHwInfoErrorneousConfigString) { if (IGFX_SKYLAKE != productFamily) { return; } @@ -17,51 +17,7 @@ TEST(SklHwInfoConfig, givenHwInfoConfigStringThenAfterSetupResultingHwInfoIsCorr GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; gtSystemInfo = {0}; - std::string strConfig = "1x3x8"; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(23u, gtSystemInfo.EUCount); - - strConfig = "2x3x8"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(2u, gtSystemInfo.SliceCount); - EXPECT_EQ(6u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(47u, gtSystemInfo.EUCount); - - strConfig = "3x3x8"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(3u, gtSystemInfo.SliceCount); - EXPECT_EQ(9u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(71u, gtSystemInfo.EUCount); - - strConfig = "1x2x6"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(2u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(11u, gtSystemInfo.EUCount); - - strConfig = "1x3x6"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(17u, gtSystemInfo.EUCount); - - strConfig = "default"; - gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, strConfig); - EXPECT_EQ(1u, gtSystemInfo.SliceCount); - EXPECT_EQ(3u, gtSystemInfo.SubSliceCount); - EXPECT_EQ(23u, gtSystemInfo.EUCount); - - strConfig = "erroneous"; - - gtSystemInfo = {0}; - + std::string strConfig = "erroneous"; EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, strConfig)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); diff --git a/unit_tests/linux/main_linux_dll.cpp b/unit_tests/linux/main_linux_dll.cpp index 9511f4e544..1d4b1d328b 100644 --- a/unit_tests/linux/main_linux_dll.cpp +++ b/unit_tests/linux/main_linux_dll.cpp @@ -243,6 +243,22 @@ TEST_F(DrmTests, failOnDeviceId) { EXPECT_EQ(drm, nullptr); } +TEST_F(DrmTests, failOnEuTotal) { + VariableBackup backupfailOnEuTotal(&failOnEuTotal); + failOnEuTotal = -1; + + auto drm = DrmWrap::createDrm(0); + EXPECT_EQ(drm, nullptr); +} + +TEST_F(DrmTests, failOnSubsliceTotal) { + VariableBackup backupfailOnSubsliceTotal(&failOnSubsliceTotal); + failOnSubsliceTotal = -1; + + auto drm = DrmWrap::createDrm(0); + EXPECT_EQ(drm, nullptr); +} + TEST_F(DrmTests, failOnRevisionId) { VariableBackup backupFailOnRevisionId(&failOnRevisionId); failOnRevisionId = -1; diff --git a/unit_tests/linux/mock_os_layer.cpp b/unit_tests/linux/mock_os_layer.cpp index 8003c058d4..5b9be8aaa0 100644 --- a/unit_tests/linux/mock_os_layer.cpp +++ b/unit_tests/linux/mock_os_layer.cpp @@ -22,6 +22,8 @@ int havePreemption = I915_SCHEDULER_CAP_ENABLED | I915_SCHEDULER_CAP_PRIORITY | I915_SCHEDULER_CAP_PREEMPTION; int failOnDeviceId = 0; +int failOnEuTotal = 0; +int failOnSubsliceTotal = 0; int failOnRevisionId = 0; int failOnSoftPin = 0; int failOnParamBoost = 0; @@ -64,6 +66,14 @@ int drmGetParam(drm_i915_getparam_t *param) { *param->value = deviceId; ret = failOnDeviceId; break; + case I915_PARAM_EU_TOTAL: + *param->value = 0; + ret = failOnEuTotal; + break; + case I915_PARAM_SUBSLICE_TOTAL: + *param->value = 0; + ret = failOnSubsliceTotal; + break; case I915_PARAM_REVISION: *param->value = 0x0; ret = failOnRevisionId; diff --git a/unit_tests/linux/mock_os_layer.h b/unit_tests/linux/mock_os_layer.h index 419b5ed392..4e9ccf84b6 100644 --- a/unit_tests/linux/mock_os_layer.h +++ b/unit_tests/linux/mock_os_layer.h @@ -34,6 +34,8 @@ extern int haveDri; // index of dri to serve, -1 - none extern int deviceId; // known DeviceID extern int haveSoftPin; extern int failOnDeviceId; +extern int failOnEuTotal; +extern int failOnSubsliceTotal; extern int failOnRevisionId; extern int failOnSoftPin; extern int failOnParamBoost; diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index 56db5ef8d3..13cb24454d 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -309,6 +309,15 @@ int main(int argc, char **argv) { } HardwareInfo hwInfo = *hardwareInfo; + + if (hwInfoConfig == "default") { + hwInfoConfig = *defaultHardwareInfoConfigTable[productFamily]; + } + + if (!setHwInfoValuesFromConfigString(hwInfoConfig, hwInfo)) { + return -1; + } + // set Gt and FeatureTable to initial state hardwareInfoSetup[productFamily](&hwInfo, setupFeatureTableAndWorkaroundTable, hwInfoConfig); FeatureTable featureTable = hwInfo.featureTable; diff --git a/unit_tests/os_interface/device_factory_tests.cpp b/unit_tests/os_interface/device_factory_tests.cpp index 88890655f7..5e2cc39d62 100644 --- a/unit_tests/os_interface/device_factory_tests.cpp +++ b/unit_tests/os_interface/device_factory_tests.cpp @@ -205,6 +205,18 @@ TEST_F(DeviceFactoryTest, givenSetCommandStreamReceiverInAubModeWhenGetDevicesFo } } +TEST_F(DeviceFactoryTest, givenInvalidHwConfigStringGetDevicesForProductFamilyOverrideReturnsFalse) { + DeviceFactoryCleaner cleaner; + DebugManagerStateRestore stateRestore; + DebugManager.flags.HardwareInfoOverride.set("1x3"); + + MockExecutionEnvironment executionEnvironment(*platformDevices); + + size_t numDevices = 0; + bool success = DeviceFactory::getDevicesForProductFamilyOverride(numDevices, executionEnvironment); + EXPECT_FALSE(success); +} + TEST_F(DeviceFactoryTest, givenGetDevicesCallWhenItIsDoneThenOsInterfaceIsAllocated) { DeviceFactoryCleaner cleaner; diff --git a/unit_tests/os_interface/hw_info_config_tests.cpp b/unit_tests/os_interface/hw_info_config_tests.cpp index 1f8d9f13c2..b1186b4e99 100644 --- a/unit_tests/os_interface/hw_info_config_tests.cpp +++ b/unit_tests/os_interface/hw_info_config_tests.cpp @@ -29,3 +29,19 @@ void HwInfoConfigTest::SetUp() { void HwInfoConfigTest::TearDown() { PlatformFixture::TearDown(); } + +TEST_F(HwInfoConfigTest, givenHwInfoConfigSetHwInfoValuesFromConfigStringReturnsSetsProperValues) { + bool success = setHwInfoValuesFromConfigString("2x4x16", outHwInfo); + EXPECT_TRUE(success); + EXPECT_EQ(outHwInfo.gtSystemInfo.SliceCount, 2u); + EXPECT_EQ(outHwInfo.gtSystemInfo.SubSliceCount, 8u); + EXPECT_EQ(outHwInfo.gtSystemInfo.EUCount, 128u); +} + +TEST_F(HwInfoConfigTest, givenInvalidHwInfoSetHwInfoValuesFromConfigString) { + bool success = setHwInfoValuesFromConfigString("1", outHwInfo); + EXPECT_FALSE(success); + + success = setHwInfoValuesFromConfigString("1x3", outHwInfo); + EXPECT_FALSE(success); +}