Setting default device id for acronym

This PR includes:
- Move product config implementation from
ocloc arg helper to product config helper.
- Add default device id setting for each platform configuration.
- Add & move hw info config tests from opencl to shared

Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-7112
This commit is contained in:
Daria Hinz
2022-07-08 11:29:59 +00:00
committed by Compute-Runtime-Automation
parent 05ad32704b
commit 01af53b63c
100 changed files with 1773 additions and 694 deletions

View File

@ -13,6 +13,8 @@
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include "platforms.h"
using namespace NEO;
using TgllpHwInfoConfig = ::testing::Test;
@ -197,3 +199,9 @@ TGLLPTEST_F(TgllpHwInfo, givenTgllpWhenObtainingBlitterPreferenceThenReturnFalse
EXPECT_FALSE(hwInfoConfig.obtainBlitterPreference(hardwareInfo));
}
TGLLPTEST_F(TgllpHwInfo, givenHwInfoConfigWhenGetProductConfigThenCorrectMatchIsFound) {
HardwareInfo hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
EXPECT_EQ(hwInfoConfig.getProductConfigFromHwInfo(hwInfo), AOT::TGL);
}

View File

@ -9,7 +9,6 @@ if(TESTS_BXT)
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/device_tests_bxt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_bxt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_bxt.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_bxt})
add_subdirectories()

View File

@ -1,92 +0,0 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen9/hw_cmds_bxt.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
using namespace NEO;
TEST(BxtHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) {
if (IGFX_BROXTON != productFamily) {
return;
}
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
gtSystemInfo = {0};
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config));
EXPECT_EQ(0u, gtSystemInfo.SliceCount);
EXPECT_EQ(0u, gtSystemInfo.SubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.EUCount);
}
using BxtHwInfo = ::testing::Test;
BXTTEST_F(BxtHwInfo, givenBoolWhenCallBxtHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
uint64_t configs[] = {
0x100020006,
0x100030006};
bool boolValue[]{
true, false};
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
PLATFORM &platform = hwInfo.platform;
for (auto &config : configs) {
for (auto setParamBool : boolValue) {
gtSystemInfo = {0};
featureTable = {};
workaroundTable = {};
platform.usRevId = 9;
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
EXPECT_EQ(setParamBool, featureTable.flags.ftrULT);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidThreadLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftr3dMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftr3dObjectLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPerCtxtPreemptionGranularityControl);
EXPECT_EQ(setParamBool, featureTable.flags.ftrLCIA);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
EXPECT_EQ(setParamBool, featureTable.flags.ftrIA32eGfxPTEs);
EXPECT_EQ(setParamBool, featureTable.flags.ftrDisplayYTiling);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrUserModeTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrEnableGuC);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc2AddressTranslation);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbcBlitterTracking);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbcCpuTracking);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTileY);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGttCacheInvalidation);
EXPECT_EQ(setParamBool, workaroundTable.flags.waLLCCachingUnsupported);
EXPECT_EQ(setParamBool, workaroundTable.flags.waMsaa8xTileYDepthPitchAlignment);
EXPECT_EQ(setParamBool, workaroundTable.flags.waFbcLinearSurfaceStride);
EXPECT_EQ(setParamBool, workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface);
EXPECT_EQ(setParamBool, workaroundTable.flags.waEnablePreemptionGranularityControlByUMD);
EXPECT_EQ(setParamBool, workaroundTable.flags.waSendMIFLUSHBeforeVFE);
EXPECT_EQ(setParamBool, workaroundTable.flags.waForcePcBbFullCfgRestore);
EXPECT_EQ(setParamBool, workaroundTable.flags.waReportPerfCountUseGlobalContextID);
EXPECT_EQ(setParamBool, workaroundTable.flags.waSamplerCacheFlushBetweenRedescribedSurfaceReads);
platform.usRevId = 1;
featureTable = {};
hardwareInfoSetup[productFamily](&hwInfo, true, config);
EXPECT_EQ(false, featureTable.flags.ftrGttCacheInvalidation);
}
}
}

View File

@ -8,7 +8,6 @@ if(TESTS_CFL)
set(IGDRCL_SRCS_tests_gen9_cfl
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_cfl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_cfl.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_cfl})
add_subdirectories()

View File

@ -1,84 +0,0 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen9/hw_cmds_cfl.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
using namespace NEO;
TEST(CflHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) {
if (IGFX_COFFEELAKE != productFamily) {
return;
}
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
gtSystemInfo = {0};
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config));
EXPECT_EQ(0u, gtSystemInfo.SliceCount);
EXPECT_EQ(0u, gtSystemInfo.SubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.EUCount);
}
using CflHwInfo = ::testing::Test;
CFLTEST_F(CflHwInfo, givenBoolWhenCallCflHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
uint64_t configs[] = {
0x100030008,
0x200030008,
0x300030008,
0x100020006,
0x100030006};
bool boolValue[]{
true, false};
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
for (auto &config : configs) {
for (auto setParamBool : boolValue) {
gtSystemInfo = {0};
featureTable = {};
workaroundTable = {};
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidThreadLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftr3dMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftr3dObjectLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPerCtxtPreemptionGranularityControl);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
EXPECT_EQ(setParamBool, featureTable.flags.ftrSVM);
EXPECT_EQ(setParamBool, featureTable.flags.ftrIA32eGfxPTEs);
EXPECT_EQ(setParamBool, featureTable.flags.ftrDisplayYTiling);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrUserModeTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrEnableGuC);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc2AddressTranslation);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbcBlitterTracking);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbcCpuTracking);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTileY);
EXPECT_EQ(setParamBool, workaroundTable.flags.waEnablePreemptionGranularityControlByUMD);
EXPECT_EQ(setParamBool, workaroundTable.flags.waSendMIFLUSHBeforeVFE);
EXPECT_EQ(setParamBool, workaroundTable.flags.waReportPerfCountUseGlobalContextID);
EXPECT_EQ(setParamBool, workaroundTable.flags.waMsaa8xTileYDepthPitchAlignment);
EXPECT_EQ(setParamBool, workaroundTable.flags.waLosslessCompressionSurfaceStride);
EXPECT_EQ(setParamBool, workaroundTable.flags.waFbcLinearSurfaceStride);
EXPECT_EQ(setParamBool, workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface);
EXPECT_EQ(setParamBool, workaroundTable.flags.waSamplerCacheFlushBetweenRedescribedSurfaceReads);
}
}
}

View File

@ -8,7 +8,6 @@ if(TESTS_GLK)
set(IGDRCL_SRCS_tests_gen9_glk
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_glk.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_glk.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_glk})
add_subdirectories()

View File

@ -1,82 +0,0 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen9/hw_cmds_glk.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
using namespace NEO;
TEST(GlkHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) {
if (IGFX_GEMINILAKE != productFamily) {
return;
}
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
gtSystemInfo = {0};
uint64_t config = 0xdeadbeef;
gtSystemInfo = {0};
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config));
EXPECT_EQ(0u, gtSystemInfo.SliceCount);
EXPECT_EQ(0u, gtSystemInfo.SubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.EUCount);
}
using GlkHwInfo = ::testing::Test;
GLKTEST_F(GlkHwInfo, givenBoolWhenCallGlkHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
uint64_t configs[] = {
0x100020006,
0x100030006};
bool boolValue[]{
true, false};
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
for (auto &config : configs) {
for (auto setParamBool : boolValue) {
gtSystemInfo = {0};
featureTable = {};
workaroundTable = {};
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidThreadLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftr3dMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftr3dObjectLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPerCtxtPreemptionGranularityControl);
EXPECT_EQ(setParamBool, featureTable.flags.ftrLCIA);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
EXPECT_EQ(setParamBool, featureTable.flags.ftrIA32eGfxPTEs);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrUserModeTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrEnableGuC);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTileMappedResource);
EXPECT_EQ(setParamBool, featureTable.flags.ftrULT);
EXPECT_EQ(setParamBool, featureTable.flags.ftrAstcHdr2D);
EXPECT_EQ(setParamBool, featureTable.flags.ftrAstcLdr2D);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTileY);
EXPECT_EQ(setParamBool, workaroundTable.flags.waLLCCachingUnsupported);
EXPECT_EQ(setParamBool, workaroundTable.flags.waMsaa8xTileYDepthPitchAlignment);
EXPECT_EQ(setParamBool, workaroundTable.flags.waFbcLinearSurfaceStride);
EXPECT_EQ(setParamBool, workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface);
EXPECT_EQ(setParamBool, workaroundTable.flags.waEnablePreemptionGranularityControlByUMD);
EXPECT_EQ(setParamBool, workaroundTable.flags.waSendMIFLUSHBeforeVFE);
EXPECT_EQ(setParamBool, workaroundTable.flags.waForcePcBbFullCfgRestore);
EXPECT_EQ(setParamBool, workaroundTable.flags.waReportPerfCountUseGlobalContextID);
EXPECT_EQ(setParamBool, workaroundTable.flags.waSamplerCacheFlushBetweenRedescribedSurfaceReads);
}
}
}

View File

@ -8,7 +8,6 @@ if(TESTS_KBL)
set(IGDRCL_SRCS_tests_gen9_kbl
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_kbl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_kbl.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_kbl})
add_subdirectories()

View File

@ -1,95 +0,0 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/hw_test.h"
using namespace NEO;
TEST(KblHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) {
if (IGFX_KABYLAKE != productFamily) {
return;
}
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
uint64_t config = 0xdeadbeef;
gtSystemInfo = {0};
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config));
EXPECT_EQ(0u, gtSystemInfo.SliceCount);
EXPECT_EQ(0u, gtSystemInfo.SubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.EUCount);
}
using KblHwInfo = ::testing::Test;
KBLTEST_F(KblHwInfo, givenBoolWhenCallKblHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
uint64_t configs[] = {
0x100030008,
0x200030008,
0x300030008,
0x100020006,
0x100030006};
bool boolValue[]{
true, false};
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
PLATFORM &platform = hwInfo.platform;
for (auto &config : configs) {
for (auto setParamBool : boolValue) {
gtSystemInfo = {0};
featureTable = {};
workaroundTable = {};
platform.usRevId = 9;
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidThreadLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftr3dMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftr3dObjectLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPerCtxtPreemptionGranularityControl);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
EXPECT_EQ(setParamBool, featureTable.flags.ftrSVM);
EXPECT_EQ(setParamBool, featureTable.flags.ftrIA32eGfxPTEs);
EXPECT_EQ(setParamBool, featureTable.flags.ftrDisplayYTiling);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrUserModeTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrEnableGuC);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc2AddressTranslation);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbcBlitterTracking);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbcCpuTracking);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTileY);
EXPECT_EQ(setParamBool, workaroundTable.flags.waEnablePreemptionGranularityControlByUMD);
EXPECT_EQ(setParamBool, workaroundTable.flags.waSendMIFLUSHBeforeVFE);
EXPECT_EQ(setParamBool, workaroundTable.flags.waReportPerfCountUseGlobalContextID);
EXPECT_EQ(setParamBool, workaroundTable.flags.waMsaa8xTileYDepthPitchAlignment);
EXPECT_EQ(setParamBool, workaroundTable.flags.waLosslessCompressionSurfaceStride);
EXPECT_EQ(setParamBool, workaroundTable.flags.waFbcLinearSurfaceStride);
EXPECT_EQ(setParamBool, workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface);
EXPECT_EQ(setParamBool, workaroundTable.flags.waSamplerCacheFlushBetweenRedescribedSurfaceReads);
EXPECT_EQ(false, workaroundTable.flags.waDisableLSQCROPERFforOCL);
EXPECT_EQ(false, workaroundTable.flags.waEncryptedEdramOnlyPartials);
EXPECT_EQ(false, workaroundTable.flags.waForcePcBbFullCfgRestore);
platform.usRevId = 1;
workaroundTable = {};
hardwareInfoSetup[productFamily](&hwInfo, true, config);
EXPECT_EQ(true, workaroundTable.flags.waDisableLSQCROPERFforOCL);
EXPECT_EQ(true, workaroundTable.flags.waEncryptedEdramOnlyPartials);
EXPECT_EQ(true, workaroundTable.flags.waForcePcBbFullCfgRestore);
}
}
}

View File

@ -9,7 +9,6 @@ if(TESTS_SKL)
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/device_tests_skl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_skl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_skl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test_sample_skl.cpp
)

View File

@ -1,106 +0,0 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gen9/hw_cmds_skl.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
using namespace NEO;
TEST(SklHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) {
if (IGFX_SKYLAKE != productFamily) {
return;
}
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
gtSystemInfo = {0};
uint64_t config = 0xdeadbeef;
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config));
EXPECT_EQ(0u, gtSystemInfo.SliceCount);
EXPECT_EQ(0u, gtSystemInfo.SubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount);
EXPECT_EQ(0u, gtSystemInfo.EUCount);
}
using SklHwInfo = ::testing::Test;
SKLTEST_F(SklHwInfo, givenBoolWhenCallSklHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
uint64_t configs[] = {
0x100030008,
0x200030008,
0x300030008,
0x100020006,
0x100030006};
bool boolValue[]{
true, false};
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
FeatureTable &featureTable = hwInfo.featureTable;
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
PLATFORM &pPlatform = hwInfo.platform;
for (auto &config : configs) {
for (auto setParamBool : boolValue) {
gtSystemInfo = {0};
featureTable = {};
workaroundTable = {};
pPlatform.usRevId = 9;
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidThreadLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftr3dMidBatchPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftr3dObjectLevelPreempt);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPerCtxtPreemptionGranularityControl);
EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
EXPECT_EQ(setParamBool, featureTable.flags.ftrSVM);
EXPECT_EQ(setParamBool, featureTable.flags.ftrIA32eGfxPTEs);
EXPECT_EQ(setParamBool, featureTable.flags.ftrDisplayYTiling);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrUserModeTranslationTable);
EXPECT_EQ(setParamBool, featureTable.flags.ftrEnableGuC);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc2AddressTranslation);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbcBlitterTracking);
EXPECT_EQ(setParamBool, featureTable.flags.ftrFbcCpuTracking);
EXPECT_EQ(setParamBool, featureTable.flags.ftrTileY);
EXPECT_EQ(setParamBool, workaroundTable.flags.waEnablePreemptionGranularityControlByUMD);
EXPECT_EQ(setParamBool, workaroundTable.flags.waSendMIFLUSHBeforeVFE);
EXPECT_EQ(setParamBool, workaroundTable.flags.waReportPerfCountUseGlobalContextID);
EXPECT_EQ(setParamBool, workaroundTable.flags.waDisableLSQCROPERFforOCL);
EXPECT_EQ(setParamBool, workaroundTable.flags.waMsaa8xTileYDepthPitchAlignment);
EXPECT_EQ(setParamBool, workaroundTable.flags.waLosslessCompressionSurfaceStride);
EXPECT_EQ(setParamBool, workaroundTable.flags.waFbcLinearSurfaceStride);
EXPECT_EQ(setParamBool, workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface);
EXPECT_EQ(setParamBool, workaroundTable.flags.waEncryptedEdramOnlyPartials);
EXPECT_EQ(setParamBool, workaroundTable.flags.waDisableEdramForDisplayRT);
EXPECT_EQ(setParamBool, workaroundTable.flags.waForcePcBbFullCfgRestore);
EXPECT_EQ(setParamBool, workaroundTable.flags.waSamplerCacheFlushBetweenRedescribedSurfaceReads);
EXPECT_EQ(false, workaroundTable.flags.waCompressedResourceRequiresConstVA21);
EXPECT_EQ(false, workaroundTable.flags.waDisablePerCtxtPreemptionGranularityControl);
EXPECT_EQ(false, workaroundTable.flags.waModifyVFEStateAfterGPGPUPreemption);
EXPECT_EQ(false, workaroundTable.flags.waCSRUncachable);
pPlatform.usRevId = 1;
workaroundTable = {};
featureTable = {};
hardwareInfoSetup[productFamily](&hwInfo, true, config);
EXPECT_EQ(true, workaroundTable.flags.waCompressedResourceRequiresConstVA21);
EXPECT_EQ(true, workaroundTable.flags.waDisablePerCtxtPreemptionGranularityControl);
EXPECT_EQ(true, workaroundTable.flags.waModifyVFEStateAfterGPGPUPreemption);
EXPECT_EQ(true, workaroundTable.flags.waCSRUncachable);
}
}
}

View File

@ -63,7 +63,6 @@ set(IGDRCL_SRCS_offline_compiler_tests
${CMAKE_CURRENT_SOURCE_DIR}/mock/mock_iga_dll.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mock/mock_iga_dll.h
${CMAKE_CURRENT_SOURCE_DIR}/ocloc_api_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ocloc_arg_helper_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ocloc_concat_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ocloc_fatbinary_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ocloc_fatbinary_tests.h

View File

@ -19,7 +19,6 @@
class MockOclocArgHelper : public OclocArgHelper {
public:
using OclocArgHelper::deviceProductTable;
using OclocArgHelper::hasOutput;
using OclocArgHelper::headers;
using OclocArgHelper::inputs;

View File

@ -215,7 +215,7 @@ TEST(OclocApiTests, givenUnknownAcronymWhenIdsCommandIsInvokeThenErrorIsReported
TEST(OclocApiTests, WhenGoodFamilyNameIsProvidedThenSuccessIsReturned) {
std::string clFileName(clFiles + "copybuffer.cl");
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
auto allSupportedDeviceConfigs = argHelper->getAllSupportedDeviceConfigs();
auto allSupportedDeviceConfigs = argHelper->productConfigHelper->getDeviceAotInfo();
if (allSupportedDeviceConfigs.empty()) {
GTEST_SKIP();
}

View File

@ -20,6 +20,7 @@
#include "environment.h"
#include "mock/mock_argument_helper.h"
#include "mock/mock_offline_compiler.h"
#include "platforms.h"
#include <algorithm>
#include <unordered_set>
@ -53,7 +54,7 @@ auto allFilesInArchiveExceptPaddingStartsWith(const Ar::Ar &archive, const Const
}
std::string getDeviceConfig(const OfflineCompiler &offlineCompiler, MockOclocArgHelper *argHelper) {
auto allEnabledDeviceConfigs = argHelper->getAllSupportedDeviceConfigs();
auto allEnabledDeviceConfigs = argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
return {};
}
@ -68,7 +69,7 @@ std::string getDeviceConfig(const OfflineCompiler &offlineCompiler, MockOclocArg
}
std::string prepareTwoDevices(MockOclocArgHelper *argHelper) {
auto enabledProductsAcronyms = argHelper->getEnabledProductAcronyms();
auto enabledProductsAcronyms = argHelper->productConfigHelper->getRepresentativeProductAcronyms();
if (enabledProductsAcronyms.size() < 2) {
return {};
}
@ -90,7 +91,7 @@ void appendAcronymWithoutDashes(std::vector<std::string> &out, ConstStringRef ac
}
std::vector<std::string> prepareProductsWithoutDashes(OclocArgHelper *argHelper) {
auto enabledProductsAcronyms = argHelper->getEnabledProductAcronyms();
auto enabledProductsAcronyms = argHelper->productConfigHelper->getRepresentativeProductAcronyms();
if (enabledProductsAcronyms.size() < 2) {
return {};
}
@ -104,7 +105,7 @@ std::vector<std::string> prepareProductsWithoutDashes(OclocArgHelper *argHelper)
}
std::vector<std::string> prepareReleasesWithoutDashes(OclocArgHelper *argHelper) {
auto enabledReleasesAcronyms = argHelper->getEnabledReleasesAcronyms();
auto enabledReleasesAcronyms = argHelper->productConfigHelper->getReleasesAcronyms();
if (enabledReleasesAcronyms.size() < 2) {
return {};
}
@ -118,7 +119,7 @@ std::vector<std::string> prepareReleasesWithoutDashes(OclocArgHelper *argHelper)
}
std::vector<std::string> prepareFamiliesWithoutDashes(OclocArgHelper *argHelper) {
auto enabledFamiliesAcronyms = argHelper->getEnabledFamiliesAcronyms();
auto enabledFamiliesAcronyms = argHelper->productConfigHelper->getFamiliesAcronyms();
if (enabledFamiliesAcronyms.size() < 2) {
return {};
}
@ -143,9 +144,15 @@ TEST(OclocFatBinaryRequestedFatBinary, WhenDeviceArgMissingThenReturnsFalse) {
EXPECT_FALSE(NEO::requestedFatBinary(4, args, argHelper.get()));
}
TEST(OclocFatBinaryRequestedFatBinary, givenHwInfoForProductConfigWhenUnknownIsaIsPassedThenFalseIsReturned) {
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
NEO::HardwareInfo hwInfo;
EXPECT_FALSE(argHelper->getHwInfoForProductConfig(AOT::UNKNOWN_ISA, hwInfo, 0u));
}
TEST(OclocFatBinaryRequestedFatBinary, givenReleaseOrFamilyAcronymWhenGetAcronymsForTargetThenCorrectValuesAreReturned) {
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
auto &enabledDeviceConfigs = argHelper->getAllSupportedDeviceConfigs();
auto &enabledDeviceConfigs = argHelper->productConfigHelper->getDeviceAotInfo();
if (enabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -177,7 +184,7 @@ TEST(OclocFatBinaryRequestedFatBinary, givenReleaseOrFamilyAcronymWhenGetAcronym
TEST(OclocFatBinaryRequestedFatBinary, givenDeviceArgToFatBinaryWhenConfigIsNotFullThenFalseIsReturned) {
std::unique_ptr<OclocArgHelper> argHelper = std::make_unique<OclocArgHelper>();
auto allEnabledDeviceConfigs = argHelper->getAllSupportedDeviceConfigs();
auto allEnabledDeviceConfigs = argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -186,11 +193,12 @@ TEST(OclocFatBinaryRequestedFatBinary, givenDeviceArgToFatBinaryWhenConfigIsNotF
std::stringstream majorString;
majorString << aotConfig.ProductConfigID.Major;
auto major = majorString.str();
auto aotValue0 = argHelper->getProductConfigForVersionValue(major);
auto aotValue0 = argHelper->productConfigHelper->getProductConfigForVersionValue(major);
EXPECT_EQ(aotValue0, AOT::UNKNOWN_ISA);
auto majorMinor = ProductConfigHelper::parseMajorMinorValue(aotConfig);
auto aotValue1 = argHelper->getProductConfigForVersionValue(majorMinor);
auto aotValue1 = argHelper->productConfigHelper->getProductConfigForVersionValue(majorMinor);
EXPECT_EQ(aotValue1, AOT::UNKNOWN_ISA);
const char *cutRevision[] = {"ocloc", "-device", majorMinor.c_str()};
@ -225,7 +233,7 @@ TEST(OclocFatBinaryRequestedFatBinary, givenDeviceArgProvidedWhenFatBinaryFormat
}
TEST_F(OclocFatBinaryProductAcronymsTests, givenDeviceArgAsSingleProductThenFatBinaryIsNotRequested) {
auto allEnabledDeviceConfigs = oclocArgHelperWithoutInput->getAllSupportedDeviceConfigs();
auto allEnabledDeviceConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
for (const auto &deviceConfig : allEnabledDeviceConfigs) {
std::string configStr = ProductConfigHelper::parseMajorMinorRevisionValue(deviceConfig.aotConfig);
@ -241,7 +249,7 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenDeviceArgAsSingleProductThenFatB
}
TEST_F(OclocFatBinaryProductAcronymsTests, givenAsterixThenReturnAllEnabledAcronyms) {
auto expected = oclocArgHelperWithoutInput->getEnabledProductAcronyms();
auto expected = oclocArgHelperWithoutInput->productConfigHelper->getRepresentativeProductAcronyms();
auto got = NEO::getTargetProductsForFatbinary("*", oclocArgHelperWithoutInput.get());
EXPECT_EQ(got.size(), expected.size());
@ -445,7 +453,7 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenTwoSameReleaseTargetsWhenGetProd
auto acronym = enabledReleasesAcronyms[0];
std::vector<ConstStringRef> acronyms{};
auto release = ProductConfigHelper::returnReleaseForAcronym(acronym.str());
auto release = ProductConfigHelper::getReleaseForAcronym(acronym.str());
getProductsAcronymsForTarget(acronyms, release, oclocArgHelperWithoutInput.get());
auto expectedSize = acronyms.size();
getProductsAcronymsForTarget(acronyms, release, oclocArgHelperWithoutInput.get());
@ -460,7 +468,7 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenTwoSameFamilyTargetsWhenGetProdu
auto acronym = enabledFamiliesAcronyms[0];
std::vector<ConstStringRef> acronyms{};
auto family = ProductConfigHelper::returnFamilyForAcronym(acronym.str());
auto family = ProductConfigHelper::getFamilyForAcronym(acronym.str());
getProductsAcronymsForTarget(acronyms, family, oclocArgHelperWithoutInput.get());
auto expectedSize = acronyms.size();
getProductsAcronymsForTarget(acronyms, family, oclocArgHelperWithoutInput.get());
@ -475,8 +483,8 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenReleasesAcronymsWithoutDashesWhe
}
std::vector<ConstStringRef> expected{};
auto release0 = ProductConfigHelper::returnReleaseForAcronym(acronyms[0]);
auto release1 = ProductConfigHelper::returnReleaseForAcronym(acronyms[1]);
auto release0 = ProductConfigHelper::getReleaseForAcronym(acronyms[0]);
auto release1 = ProductConfigHelper::getReleaseForAcronym(acronyms[1]);
getProductsAcronymsForTarget(expected, release0, oclocArgHelperWithoutInput.get());
getProductsAcronymsForTarget(expected, release1, oclocArgHelperWithoutInput.get());
@ -492,8 +500,8 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenFamiliesAcronymsWithoutDashesWhe
}
std::vector<ConstStringRef> expected{};
auto family0 = ProductConfigHelper::returnFamilyForAcronym(acronyms[0]);
auto family1 = ProductConfigHelper::returnFamilyForAcronym(acronyms[1]);
auto family0 = ProductConfigHelper::getFamilyForAcronym(acronyms[0]);
auto family1 = ProductConfigHelper::getFamilyForAcronym(acronyms[1]);
getProductsAcronymsForTarget(expected, family0, oclocArgHelperWithoutInput.get());
getProductsAcronymsForTarget(expected, family1, oclocArgHelperWithoutInput.get());
@ -511,8 +519,8 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenTwoTargetsOfReleasesWhenFatBinar
auto acronym1 = enabledReleasesAcronyms.at(product + 1);
std::vector<ConstStringRef> expected{};
auto release0 = ProductConfigHelper::returnReleaseForAcronym(acronym0.str());
auto release1 = ProductConfigHelper::returnReleaseForAcronym(acronym1.str());
auto release0 = ProductConfigHelper::getReleaseForAcronym(acronym0.str());
auto release1 = ProductConfigHelper::getReleaseForAcronym(acronym1.str());
getProductsAcronymsForTarget(expected, release0, oclocArgHelperWithoutInput.get());
getProductsAcronymsForTarget(expected, release1, oclocArgHelperWithoutInput.get());
@ -552,8 +560,8 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenTwoTargetsOfFamiliesWhenFatBinar
auto acronym1 = enabledFamiliesAcronyms.at(product + 1);
std::vector<ConstStringRef> expected{};
auto family0 = ProductConfigHelper::returnFamilyForAcronym(acronym0.str());
auto family1 = ProductConfigHelper::returnFamilyForAcronym(acronym1.str());
auto family0 = ProductConfigHelper::getFamilyForAcronym(acronym0.str());
auto family1 = ProductConfigHelper::getFamilyForAcronym(acronym1.str());
getProductsAcronymsForTarget(expected, family0, oclocArgHelperWithoutInput.get());
getProductsAcronymsForTarget(expected, family1, oclocArgHelperWithoutInput.get());
@ -671,8 +679,8 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenReleasesClosedRangeWithoutDashes
if (acronyms.size() < 2) {
GTEST_SKIP();
}
auto releaseFromIt = ProductConfigHelper::returnReleaseForAcronym(acronyms[0]);
auto releaseToIt = ProductConfigHelper::returnReleaseForAcronym(acronyms[1]);
auto releaseFromIt = ProductConfigHelper::getReleaseForAcronym(acronyms[0]);
auto releaseToIt = ProductConfigHelper::getReleaseForAcronym(acronyms[1]);
if (releaseFromIt > releaseToIt) {
std::swap(releaseFromIt, releaseToIt);
@ -694,8 +702,8 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenFamiliesClosedRangeWithoutDashes
GTEST_SKIP();
}
auto familyFromIt = ProductConfigHelper::returnFamilyForAcronym(acronyms[0]);
auto familyToIt = ProductConfigHelper::returnFamilyForAcronym(acronyms[1]);
auto familyFromIt = ProductConfigHelper::getFamilyForAcronym(acronyms[0]);
auto familyToIt = ProductConfigHelper::getFamilyForAcronym(acronyms[1]);
if (familyFromIt > familyToIt) {
std::swap(familyFromIt, familyToIt);
@ -723,8 +731,8 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenFamiliesClosedRangeWhenFatBinary
auto acronymFrom = enabledFamiliesAcronyms.at(family);
auto acronymTo = enabledFamiliesAcronyms.at(enabledFamiliesAcronyms.size() / 2);
auto familyFromIt = ProductConfigHelper::returnFamilyForAcronym(acronymFrom.str());
auto familyToIt = ProductConfigHelper::returnFamilyForAcronym(acronymTo.str());
auto familyFromIt = ProductConfigHelper::getFamilyForAcronym(acronymFrom.str());
auto familyToIt = ProductConfigHelper::getFamilyForAcronym(acronymTo.str());
if (familyFromIt > familyToIt) {
std::swap(familyFromIt, familyToIt);
@ -870,7 +878,7 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenOpenRangeFromReleaseWithoutDashe
}
std::vector<ConstStringRef> expected{};
auto releaseFromId = ProductConfigHelper::returnReleaseForAcronym(acronyms[0]);
auto releaseFromId = ProductConfigHelper::getReleaseForAcronym(acronyms[0]);
auto releaseToId = AOT::RELEASE_MAX;
while (releaseFromId < releaseToId) {
getProductsAcronymsForTarget(expected, releaseFromId, oclocArgHelperWithoutInput.get());
@ -890,7 +898,7 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenOpenRangeFromReleaseWhenFatBinar
for (const auto &release : enabledReleasesAcronyms) {
std::vector<ConstStringRef> expected{};
auto releaseFromId = ProductConfigHelper::returnReleaseForAcronym(release.str());
auto releaseFromId = ProductConfigHelper::getReleaseForAcronym(release.str());
auto releaseToId = AOT::RELEASE_MAX;
while (releaseFromId < releaseToId) {
getProductsAcronymsForTarget(expected, releaseFromId, oclocArgHelperWithoutInput.get());
@ -932,7 +940,7 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenOpenRangeToReleaseWhenFatBinaryB
std::vector<ConstStringRef> expected{};
auto releaseFromId = static_cast<AOT::RELEASE>(static_cast<unsigned int>(AOT::UNKNOWN_RELEASE) + 1);
auto releaseToId = ProductConfigHelper::returnReleaseForAcronym(release.str());
auto releaseToId = ProductConfigHelper::getReleaseForAcronym(release.str());
while (releaseFromId <= releaseToId) {
getProductsAcronymsForTarget(expected, releaseFromId, oclocArgHelperWithoutInput.get());
@ -972,7 +980,7 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenOpenRangeFromFamilyWithoutDashes
}
std::vector<ConstStringRef> expected{};
auto familyFromId = ProductConfigHelper::returnFamilyForAcronym(acronyms[0]);
auto familyFromId = ProductConfigHelper::getFamilyForAcronym(acronyms[0]);
auto familyToId = AOT::FAMILY_MAX;
while (familyFromId < familyToId) {
getProductsAcronymsForTarget(expected, familyFromId, oclocArgHelperWithoutInput.get());
@ -992,7 +1000,7 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenOpenRangeFromFamilyWhenFatBinary
for (const auto &family : enabledFamiliesAcronyms) {
std::vector<ConstStringRef> expected{};
auto familyFromId = ProductConfigHelper::returnFamilyForAcronym(family.str());
auto familyFromId = ProductConfigHelper::getFamilyForAcronym(family.str());
auto familyToId = AOT::FAMILY_MAX;
while (familyFromId < familyToId) {
getProductsAcronymsForTarget(expected, familyFromId, oclocArgHelperWithoutInput.get());
@ -1034,7 +1042,7 @@ TEST_F(OclocFatBinaryProductAcronymsTests, givenOpenRangeToFamilyWhenFatBinaryBu
std::vector<ConstStringRef> expected{};
auto familyFromId = static_cast<AOT::FAMILY>(static_cast<unsigned int>(AOT::UNKNOWN_FAMILY) + 1);
auto familyToId = ProductConfigHelper::returnFamilyForAcronym(family.str());
auto familyToId = ProductConfigHelper::getFamilyForAcronym(family.str());
while (familyFromId <= familyToId) {
getProductsAcronymsForTarget(expected, familyFromId, oclocArgHelperWithoutInput.get());

View File

@ -17,7 +17,7 @@
namespace NEO {
class OclocEnabledAcronyms : public ::testing::Test {
public:
std::vector<DeviceMapping> enabledProducts{};
std::vector<DeviceAotInfo> enabledProducts{};
std::vector<ConstStringRef> enabledProductsAcronyms{};
std::vector<ConstStringRef> enabledFamiliesAcronyms{};
std::vector<ConstStringRef> enabledReleasesAcronyms{};
@ -29,10 +29,10 @@ class OclocFatBinaryProductAcronymsTests : public OclocEnabledAcronyms {
oclocArgHelperWithoutInput = std::make_unique<OclocArgHelper>();
oclocArgHelperWithoutInput->getPrinterRef() = MessagePrinter{true};
enabledProducts = oclocArgHelperWithoutInput->getAllSupportedDeviceConfigs();
enabledProductsAcronyms = oclocArgHelperWithoutInput->getEnabledProductAcronyms();
enabledFamiliesAcronyms = oclocArgHelperWithoutInput->getEnabledFamiliesAcronyms();
enabledReleasesAcronyms = oclocArgHelperWithoutInput->getEnabledReleasesAcronyms();
enabledProducts = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
enabledProductsAcronyms = oclocArgHelperWithoutInput->productConfigHelper->getRepresentativeProductAcronyms();
enabledFamiliesAcronyms = oclocArgHelperWithoutInput->productConfigHelper->getFamiliesAcronyms();
enabledReleasesAcronyms = oclocArgHelperWithoutInput->productConfigHelper->getReleasesAcronyms();
}
std::unique_ptr<OclocArgHelper> oclocArgHelperWithoutInput;
@ -44,10 +44,10 @@ class OclocFatBinaryTest : public OclocEnabledAcronyms {
mockArgHelperFilesMap[spirvFilename] = spirvFileContent;
mockArgHelper.interceptOutput = true;
enabledProducts = mockArgHelper.getAllSupportedDeviceConfigs();
enabledProductsAcronyms = mockArgHelper.getEnabledProductAcronyms();
enabledFamiliesAcronyms = mockArgHelper.getEnabledFamiliesAcronyms();
enabledReleasesAcronyms = mockArgHelper.getEnabledReleasesAcronyms();
enabledProducts = mockArgHelper.productConfigHelper->getDeviceAotInfo();
enabledProductsAcronyms = mockArgHelper.productConfigHelper->getRepresentativeProductAcronyms();
enabledFamiliesAcronyms = mockArgHelper.productConfigHelper->getFamiliesAcronyms();
enabledReleasesAcronyms = mockArgHelper.productConfigHelper->getReleasesAcronyms();
}
protected:

View File

@ -13,13 +13,11 @@ namespace NEO {
TEST_P(OclocProductConfigTests, GivenProductConfigValuesWhenInitHardwareInfoThenCorrectValuesAreSet) {
auto deviceId = 0u;
auto revId = 0u;
auto allSupportedDeviceConfigs = mockOfflineCompiler->argHelper->getAllSupportedDeviceConfigs();
auto allSupportedConfigs = mockOfflineCompiler->argHelper->productConfigHelper->getDeviceAotInfo();
for (const auto &deviceConfig : allSupportedDeviceConfigs) {
for (const auto &deviceConfig : allSupportedConfigs) {
if (aotConfig.ProductConfig == deviceConfig.aotConfig.ProductConfig) {
if (deviceConfig.deviceIds) {
deviceId = deviceConfig.deviceIds->front();
}
deviceId = deviceConfig.deviceIds->front();
revId = deviceConfig.aotConfig.ProductConfigID.Revision;
break;
}

View File

@ -91,32 +91,3 @@ TEST(OclocValidate, WhenErrorsEmitedThenRedirectsThemToStdout) {
EXPECT_EQ(static_cast<int>(NEO::DecodeError::InvalidBinary), res) << oclocStdout;
EXPECT_NE(nullptr, strstr(oclocStdout.c_str(), "Validator detected errors :\nNEO::Yaml : Could not parse line : [1] : [kernels ] <-- parser position on error. Reason : Vector data type expects to have at least one value starting with -")) << oclocStdout;
}
TEST(OclocValidate, givenDeviceProductTableEveryProductMatchesProperPattern) {
MockOclocArgHelper::FilesMap files{{"src.gen", "01234567"}};
MockOclocArgHelper argHelper{files};
ASSERT_GE(argHelper.deviceProductTable.size(), 1u);
std::vector<std::string> genPatterns;
for (int j = 0; j < IGFX_MAX_PRODUCT; j++) {
if (NEO::hardwarePrefix[j] == nullptr)
continue;
genPatterns.push_back(NEO::hardwarePrefix[j]);
}
ASSERT_GE(genPatterns.size(), 1u);
if (argHelper.deviceProductTable.size() == 1 && argHelper.deviceProductTable[0].deviceId == 0) {
auto &deviceProductTable = const_cast<std::vector<DeviceProduct> &>(argHelper.deviceProductTable);
deviceProductTable[0].product = genPatterns[0];
deviceProductTable[0].deviceId = 0x123;
deviceProductTable.push_back(DeviceProduct{0, ""});
}
for (int i = 0; argHelper.deviceProductTable[i].deviceId != 0; i++) {
auto res = std::find(genPatterns.begin(), genPatterns.end(), argHelper.returnProductNameForDevice(argHelper.deviceProductTable[i].deviceId));
EXPECT_NE(res, genPatterns.end());
}
}

View File

@ -29,6 +29,7 @@
#include "mock/mock_argument_helper.h"
#include "mock/mock_multi_command.h"
#include "mock/mock_offline_compiler.h"
#include "platforms.h"
#include <algorithm>
#include <array>
@ -185,7 +186,7 @@ TEST_F(MultiCommandTests, GivenSpecifiedOutputDirWhenBuildingMultiCommandThenSuc
}
TEST_F(MultiCommandTests, GivenSpecifiedOutputDirWithProductConfigValueWhenBuildingMultiCommandThenSuccessIsReturned) {
auto allEnabledDeviceConfigs = oclocArgHelperWithoutInput->getAllSupportedDeviceConfigs();
auto allEnabledDeviceConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -522,7 +523,7 @@ TEST(MultiCommandWhiteboxTest, GivenInvalidArgsWhenInitializingThenErrorIsReturn
using MockOfflineCompilerTests = ::testing::Test;
TEST_F(MockOfflineCompilerTests, givenProductConfigValueAndRevisionIdWhenInitHwInfoThenTheseValuesAreSet) {
MockOfflineCompiler mockOfflineCompiler;
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->getAllSupportedDeviceConfigs();
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -546,7 +547,7 @@ TEST_F(MockOfflineCompilerTests, givenProductConfigValueAndRevisionIdWhenInitHwI
TEST_F(MockOfflineCompilerTests, givenProductConfigValueWhenInitHwInfoThenBaseHardwareInfoValuesAreSet) {
MockOfflineCompiler mockOfflineCompiler;
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->getAllSupportedDeviceConfigs();
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -569,7 +570,7 @@ TEST_F(MockOfflineCompilerTests, givenProductConfigValueWhenInitHwInfoThenBaseHa
TEST_F(MockOfflineCompilerTests, givenDeprecatedAcronymsWithRevisionWhenInitHwInfoThenValuesAreSetAndSuccessIsReturned) {
MockOfflineCompiler mockOfflineCompiler;
auto deprecatedAcronyms = mockOfflineCompiler.argHelper->getDeprecatedAcronyms();
auto deprecatedAcronyms = mockOfflineCompiler.argHelper->productConfigHelper->getDeprecatedAcronyms();
if (deprecatedAcronyms.empty()) {
GTEST_SKIP();
}
@ -584,7 +585,7 @@ TEST_F(MockOfflineCompilerTests, givenDeprecatedAcronymsWithRevisionWhenInitHwIn
TEST_F(MockOfflineCompilerTests, givenHwInfoConfigWhenSetHwInfoForProductConfigThenCorrectValuesAreSet) {
MockOfflineCompiler mockOfflineCompiler;
auto enabledProductAcronyms = mockOfflineCompiler.argHelper->getEnabledProductAcronyms();
auto enabledProductAcronyms = mockOfflineCompiler.argHelper->productConfigHelper->getRepresentativeProductAcronyms();
if (enabledProductAcronyms.empty()) {
GTEST_SKIP();
}
@ -610,7 +611,7 @@ TEST_F(MockOfflineCompilerTests, givenHwInfoConfigWhenSetHwInfoForProductConfigT
TEST_F(MockOfflineCompilerTests, givenHwInfoConfigWhenSetHwInfoForDeprecatedAcronymsThenCorrectValuesAreSet) {
MockOfflineCompiler mockOfflineCompiler;
auto deprecatedAcronyms = mockOfflineCompiler.argHelper->getDeprecatedAcronyms();
auto deprecatedAcronyms = mockOfflineCompiler.argHelper->productConfigHelper->getDeprecatedAcronyms();
if (deprecatedAcronyms.empty()) {
GTEST_SKIP();
}
@ -635,7 +636,7 @@ TEST_F(MockOfflineCompilerTests, givenHwInfoConfigWhenSetHwInfoForDeprecatedAcro
TEST_F(MockOfflineCompilerTests, givenAcronymWithUppercaseWhenInitHwInfoThenSuccessIsReturned) {
MockOfflineCompiler mockOfflineCompiler;
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->getAllSupportedDeviceConfigs();
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -658,7 +659,7 @@ TEST_F(MockOfflineCompilerTests, givenAcronymWithUppercaseWhenInitHwInfoThenSucc
TEST_F(MockOfflineCompilerTests, givenDeprecatedAcronymsWithUppercaseWhenInitHwInfoThenSuccessIsReturned) {
MockOfflineCompiler mockOfflineCompiler;
auto deprecatedAcronyms = mockOfflineCompiler.argHelper->getDeprecatedAcronyms();
auto deprecatedAcronyms = mockOfflineCompiler.argHelper->productConfigHelper->getDeprecatedAcronyms();
if (deprecatedAcronyms.empty()) {
GTEST_SKIP();
}
@ -672,7 +673,7 @@ TEST_F(MockOfflineCompilerTests, givenDeprecatedAcronymsWithUppercaseWhenInitHwI
HWTEST2_F(MockOfflineCompilerTests, givenProductConfigValueWhenInitHwInfoThenMaxDualSubSlicesSupportedIsSet, IsAtLeastGen12lp) {
MockOfflineCompiler mockOfflineCompiler;
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->getAllSupportedDeviceConfigs();
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
@ -728,14 +729,14 @@ All supported acronyms: )===";
}
TEST_F(OfflineCompilerTests, givenFamilyAcronymWhenIdsCommandIsInvokeThenSuccessAndCorrectIdsAreReturned) {
auto enabledFamilies = oclocArgHelperWithoutInput->getEnabledFamiliesAcronyms();
auto enabledFamilies = oclocArgHelperWithoutInput->productConfigHelper->getFamiliesAcronyms();
if (enabledFamilies.empty()) {
GTEST_SKIP();
}
auto supportedDevicesConfigs = oclocArgHelperWithoutInput->getAllSupportedDeviceConfigs();
auto supportedDevicesConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
for (const auto &familyAcronym : enabledFamilies) {
std::vector<std::string> expected{};
auto family = ProductConfigHelper::returnFamilyForAcronym(familyAcronym.str());
auto family = ProductConfigHelper::getFamilyForAcronym(familyAcronym.str());
for (const auto &device : supportedDevicesConfigs) {
if (device.family == family) {
auto config = ProductConfigHelper::parseMajorMinorRevisionValue(device.aotConfig);
@ -762,14 +763,14 @@ TEST_F(OfflineCompilerTests, givenFamilyAcronymWhenIdsCommandIsInvokeThenSuccess
}
TEST_F(OfflineCompilerTests, givenReleaseAcronymWhenIdsCommandIsInvokeThenSuccessAndCorrectIdsAreReturned) {
auto enabledReleases = oclocArgHelperWithoutInput->getEnabledReleasesAcronyms();
auto enabledReleases = oclocArgHelperWithoutInput->productConfigHelper->getReleasesAcronyms();
if (enabledReleases.empty()) {
GTEST_SKIP();
}
auto supportedDevicesConfigs = oclocArgHelperWithoutInput->getAllSupportedDeviceConfigs();
auto supportedDevicesConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
for (const auto &releaseAcronym : enabledReleases) {
std::vector<std::string> expected{};
auto release = ProductConfigHelper::returnReleaseForAcronym(releaseAcronym.str());
auto release = ProductConfigHelper::getReleaseForAcronym(releaseAcronym.str());
for (const auto &device : supportedDevicesConfigs) {
if (device.release == release) {
auto config = ProductConfigHelper::parseMajorMinorRevisionValue(device.aotConfig);
@ -796,14 +797,14 @@ TEST_F(OfflineCompilerTests, givenReleaseAcronymWhenIdsCommandIsInvokeThenSucces
}
TEST_F(OfflineCompilerTests, givenProductAcronymWhenIdsCommandIsInvokeThenSuccessAndCorrectIdsAreReturned) {
auto enabledProducts = oclocArgHelperWithoutInput->getEnabledProductAcronyms();
auto enabledProducts = oclocArgHelperWithoutInput->productConfigHelper->getAllProductAcronyms();
if (enabledProducts.empty()) {
GTEST_SKIP();
}
auto supportedDevicesConfigs = oclocArgHelperWithoutInput->getAllSupportedDeviceConfigs();
auto supportedDevicesConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
for (const auto &productAcronym : enabledProducts) {
std::vector<std::string> expected{};
auto product = ProductConfigHelper::returnProductConfigForAcronym(productAcronym.str());
auto product = ProductConfigHelper::getProductConfigForAcronym(productAcronym.str());
for (const auto &device : supportedDevicesConfigs) {
if (device.aotConfig.ProductConfig == product) {
auto config = ProductConfigHelper::parseMajorMinorRevisionValue(device.aotConfig);
@ -1027,10 +1028,11 @@ TEST_F(OfflineCompilerTests, GivenArgsWhenOfflineCompilerIsCreatedThenSuccessIsR
}
TEST_F(OfflineCompilerTests, givenDeviceIdHexValueWhenInitHwInfoThenItHasCorrectlySetValues) {
auto deviceId = oclocArgHelperWithoutInput->deviceProductTable[0].deviceId;
if (oclocArgHelperWithoutInput->deviceProductTable.size() == 1 && deviceId == 0) {
auto deviceAot = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
if (deviceAot.empty()) {
GTEST_SKIP();
}
auto deviceId = deviceAot[0].deviceIds->front();
MockOfflineCompiler mockOfflineCompiler;
std::stringstream deviceString, productString;
@ -1042,13 +1044,17 @@ TEST_F(OfflineCompilerTests, givenDeviceIdHexValueWhenInitHwInfoThenItHasCorrect
}
TEST_F(OfflineCompilerTests, givenProperDeviceIdHexAsDeviceArgumentThenSuccessIsReturned) {
auto deviceId = oclocArgHelperWithoutInput->deviceProductTable[0].deviceId;
if (oclocArgHelperWithoutInput->deviceProductTable.size() == 1 && deviceId == 0) {
auto deviceAotInfo = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
if (deviceAotInfo.empty()) {
GTEST_SKIP();
}
std::stringstream deviceString, productString;
AOT::PRODUCT_CONFIG config;
auto deviceId = deviceAotInfo[0].deviceIds->front();
deviceString << "0x" << std::hex << deviceId;
productString << oclocArgHelperWithoutInput->deviceProductTable[0].product;
config = static_cast<AOT::PRODUCT_CONFIG>(deviceAotInfo[0].aotConfig.ProductConfig);
productString << oclocArgHelperWithoutInput->productConfigHelper->getAcronymForProductConfig(config);
std::vector<std::string> argv = {
"ocloc",
@ -1086,7 +1092,7 @@ TEST_F(OfflineCompilerTests, givenIncorrectDeviceIdHexThenInvalidDeviceIsReturne
auto output = testing::internal::GetCapturedStdout();
EXPECT_EQ(nullptr, pOfflineCompiler);
EXPECT_STREQ(output.c_str(), "Could not determine target based on device id: 0x0\nError: Cannot get HW Info for device 0x0.\n");
EXPECT_STREQ(output.c_str(), "Could not determine device target: 0x0\nError: Cannot get HW Info for device 0x0.\n");
EXPECT_EQ(CL_INVALID_DEVICE, retVal);
}
@ -1182,11 +1188,10 @@ TEST_F(OfflineCompilerTests, givenDeviceNumerationWhenPassedValuesAreOutOfRangeT
TEST_F(OfflineCompilerTests, givenInitHardwareInfowhenDeviceConfigContainsDeviceIdsThenSetFirstDeviceId) {
MockOfflineCompiler mockOfflineCompiler;
auto &allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->getAllSupportedDeviceConfigs();
auto &allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
std::vector<unsigned short> deviceIdsForTests = {0xfffd, 0xfffe, 0xffff};
for (auto &deviceMapConfig : allEnabledDeviceConfigs) {
@ -1622,7 +1627,7 @@ TEST_F(OfflineCompilerTests, GivenArgsWhenBuildingThenBuildSucceeds) {
}
TEST_F(OfflineCompilerTests, GivenArgsWhenBuildingWithDeviceConfigValueThenBuildSucceeds) {
auto allEnabledDeviceConfigs = oclocArgHelperWithoutInput->getAllSupportedDeviceConfigs();
auto allEnabledDeviceConfigs = oclocArgHelperWithoutInput->productConfigHelper->getDeviceAotInfo();
if (allEnabledDeviceConfigs.empty()) {
return;
}
@ -1962,7 +1967,7 @@ TEST(OfflineCompilerTest, GivenUnsupportedDeviceConfigWhenInitHardwareInfoThenIn
EXPECT_EQ(retVal, OclocErrorCode::INVALID_DEVICE);
auto output = testing::internal::GetCapturedStdout();
resString << "Could not determine target based on product config: " << deviceName << "\n";
resString << "Could not determine device target: " << deviceName << "\n";
EXPECT_STREQ(output.c_str(), resString.str().c_str());
}
@ -3293,39 +3298,6 @@ TEST(OclocArgHelperTest, GivenNoOutputPrintMessages) {
EXPECT_STREQ(printMsg.data(), capturedStdout.c_str());
}
TEST(OclocArgHelperTest, GivenDifferentAotConfigsInDeviceMappingsWhenComparingThemThenFalseIsReturned) {
DeviceMapping lhs{};
DeviceMapping rhs{};
ASSERT_TRUE(lhs == rhs);
lhs.aotConfig = {AOT::CONFIG_MAX_PLATFORM};
rhs.aotConfig = {AOT::UNKNOWN_ISA};
EXPECT_FALSE(lhs == rhs);
}
TEST(OclocArgHelperTest, GivenDifferentFamiliesInDeviceMappingsWhenComparingThemThenFalseIsReturned) {
DeviceMapping lhs{};
DeviceMapping rhs{};
ASSERT_TRUE(lhs == rhs);
lhs.family = AOT::FAMILY_MAX;
rhs.family = AOT::UNKNOWN_FAMILY;
EXPECT_FALSE(lhs == rhs);
}
TEST(OclocArgHelperTest, GivenDifferentReleasesInDeviceMappingsWhenComparingThemThenFalseIsReturned) {
DeviceMapping lhs{};
DeviceMapping rhs{};
ASSERT_TRUE(lhs == rhs);
lhs.release = AOT::RELEASE_MAX;
rhs.release = AOT::UNKNOWN_RELEASE;
EXPECT_FALSE(lhs == rhs);
}
TEST(OclocArgHelperTest, GivenValidHeaderFileWhenRequestingHeadersAsVectorOfStringsThenLinesAreStored) {
const char input[] = "First\nSecond\nThird";
const auto inputLength{sizeof(input)};

View File

@ -21,7 +21,7 @@ using HwHelperTestsPvcXt = Test<HwHelperTestsXeHpcCore>;
PVCTEST_F(HwHelperTestsPvcXt, givenSingleTileCsrOnPvcXtWhenAllocatingCsrSpecificAllocationsAndIsNotBaseDieA0ThenStoredInProperMemoryPool) {
auto hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
hwInfo.platform.usDeviceID = PVC_XT_IDS.front();
hwInfo.platform.usDeviceID = pvcXtDeviceIds.front();
hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); // not BD A0
checkIfSingleTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInProperMemoryPool(&hwInfo);
}
@ -29,7 +29,7 @@ PVCTEST_F(HwHelperTestsPvcXt, givenSingleTileCsrOnPvcXtWhenAllocatingCsrSpecific
PVCTEST_F(HwHelperTestsPvcXt, givenMultiTileCsrOnPvcWhenAllocatingCsrSpecificAllocationsAndIsNotBaseDieA0ThenStoredInLocalMemoryPool) {
auto hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
hwInfo.platform.usDeviceID = PVC_XT_IDS.front();
hwInfo.platform.usDeviceID = pvcXtDeviceIds.front();
hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); // not BD A0
checkIfMultiTileCsrWhenAllocatingCsrSpecificAllocationsThenStoredInLocalMemoryPool(&hwInfo);
}

View File

@ -1,11 +1,11 @@
#
# Copyright (C) 2021 Intel Corporation
# Copyright (C) 2021-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
set(IGDRCL_SRCS_linux_dll_tests_xe_hpc_core_pvc
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/${BRANCH_DIR_SUFFIX}/device_id_tests_pvc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/device_id_tests_pvc.cpp
)
target_sources(igdrcl_linux_dll_tests PRIVATE ${IGDRCL_SRCS_linux_dll_tests_xe_hpc_core_pvc})

View File

@ -9,7 +9,7 @@
using namespace NEO;
TEST_F(DeviceIdTests, GivenPvcSupportedDeviceIdThenConfigIsCorrect) {
PVCTEST_F(DeviceIdTests, GivenPvcSupportedDeviceIdThenConfigIsCorrect) {
std::array<DeviceDescriptor, 8> expectedDescriptors = {{
{0x0BD0, &PvcHwConfig::hwInfo, &PvcHwConfig::setupHardwareInfo},
{0x0BD5, &PvcHwConfig::hwInfo, &PvcHwConfig::setupHardwareInfo},

View File

@ -9,13 +9,13 @@
#include "shared/source/helpers/constants.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/xe_hpc_core/hw_cmds_pvc.h"
#include "shared/source/xe_hpc_core/pvc/device_ids_configs_pvc.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
#include "shared/test/common/test_macros/test.h"
#include "shared/test/unit_test/helpers/gtest_helpers.h"
#include "device_ids_configs_pvc.h"
#include "gtest/gtest.h"
using namespace NEO;
@ -112,12 +112,12 @@ PVCTEST_F(PvcHwInfo, givenDeviceIdThenProperMaxThreadsForWorkgroupIsReturned) {
HardwareInfo hwInfo = *defaultHwInfo;
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
for (auto &deviceId : PVC_XL_IDS) {
for (const auto &deviceId : pvcXlDeviceIds) {
hwInfo.platform.usDeviceID = deviceId;
EXPECT_EQ(64u, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hwInfo, 64u, 64u));
}
for (auto &deviceId : PVC_XT_IDS) {
for (const auto &deviceId : pvcXtDeviceIds) {
hwInfo.platform.usDeviceID = deviceId;
uint32_t numThreadsPerEU = hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
EXPECT_EQ(64u * numThreadsPerEU, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hwInfo, 64u, 64u));
@ -128,31 +128,31 @@ PVCTEST_F(PvcHwInfo, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConve
auto hwInfo = *defaultHwInfo;
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
std::vector<unsigned short> deviceIds = PVC_XL_IDS;
deviceIds.insert(deviceIds.end(), PVC_XT_IDS.begin(), PVC_XT_IDS.end());
for (uint32_t testValue = 0; testValue < 0xFF; testValue++) {
for (auto deviceId : deviceIds) {
hwInfo.platform.usDeviceID = deviceId;
auto hwRevIdFromStepping = hwInfoConfig.getHwRevIdFromStepping(testValue, hwInfo);
if (hwRevIdFromStepping != CommonConstants::invalidStepping) {
hwInfo.platform.usRevId = hwRevIdFromStepping;
EXPECT_EQ(testValue, hwInfoConfig.getSteppingFromHwRevId(hwInfo));
for (const auto &pvc : {pvcXlDeviceIds, pvcXtDeviceIds}) {
for (const auto &deviceId : pvc) {
hwInfo.platform.usDeviceID = deviceId;
auto hwRevIdFromStepping = hwInfoConfig.getHwRevIdFromStepping(testValue, hwInfo);
if (hwRevIdFromStepping != CommonConstants::invalidStepping) {
hwInfo.platform.usRevId = hwRevIdFromStepping;
EXPECT_EQ(testValue, hwInfoConfig.getSteppingFromHwRevId(hwInfo));
}
}
}
hwInfo.platform.usRevId = testValue;
auto steppingFromHwRevId = hwInfoConfig.getSteppingFromHwRevId(hwInfo);
if (steppingFromHwRevId != CommonConstants::invalidStepping) {
bool anyMatchAfterConversionFromStepping = false;
for (auto deviceId : deviceIds) {
hwInfo.platform.usDeviceID = deviceId;
auto hwRevId = hwInfoConfig.getHwRevIdFromStepping(steppingFromHwRevId, hwInfo);
EXPECT_NE(CommonConstants::invalidStepping, hwRevId);
// expect values to match. 0x1 and 0x0 translate to the same stepping so they are interpreted as a match too.
if (((testValue & PVC::pvcSteppingBits) == (hwRevId & PVC::pvcSteppingBits)) ||
(((testValue & PVC::pvcSteppingBits) == 0x1) && ((hwRevId & PVC::pvcSteppingBits) == 0x0))) {
anyMatchAfterConversionFromStepping = true;
for (const auto &pvc : {pvcXlDeviceIds, pvcXtDeviceIds}) {
for (const auto &deviceId : pvc) {
hwInfo.platform.usDeviceID = deviceId;
auto hwRevId = hwInfoConfig.getHwRevIdFromStepping(steppingFromHwRevId, hwInfo);
EXPECT_NE(CommonConstants::invalidStepping, hwRevId);
// expect values to match. 0x1 and 0x0 translate to the same stepping so they are interpreted as a match too.
if (((testValue & PVC::pvcSteppingBits) == (hwRevId & PVC::pvcSteppingBits)) ||
(((testValue & PVC::pvcSteppingBits) == 0x1) && ((hwRevId & PVC::pvcSteppingBits) == 0x0))) {
anyMatchAfterConversionFromStepping = true;
}
}
}
EXPECT_TRUE(anyMatchAfterConversionFromStepping);
@ -164,12 +164,12 @@ PVCTEST_F(PvcHwInfo, givenPvcHwInfoConfigWhenIsIpSamplingSupportedThenCorrectRes
const auto &hwInfoConfig = *HwInfoConfig::get(productFamily);
auto hwInfo = *defaultHwInfo;
for (auto &deviceId : PVC_XL_IDS) {
for (const auto &deviceId : pvcXlDeviceIds) {
hwInfo.platform.usDeviceID = deviceId;
EXPECT_FALSE(hwInfoConfig.isIpSamplingSupported(hwInfo));
}
for (auto &deviceId : PVC_XT_IDS) {
for (const auto &deviceId : pvcXtDeviceIds) {
hwInfo.platform.usDeviceID = deviceId;
EXPECT_TRUE(hwInfoConfig.isIpSamplingSupported(hwInfo));
}

View File

@ -41,7 +41,7 @@ DG2TEST_F(Dg2UsDeviceIdTest, givenDeviceThatHasHighNumberOfExecutionUnitsA0Stepp
mySysInfo.DualSubSliceCount = 2;
mySysInfo.ThreadCount = 32 * 8;
myPlatform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
myPlatform.usDeviceID = DG2_G10_IDS[0];
myPlatform.usDeviceID = dg2G10DeviceIds[0];
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
EXPECT_EQ(512u, device->sharedDeviceInfo.maxWorkGroupSize);
@ -59,7 +59,7 @@ DG2TEST_F(Dg2UsDeviceIdTest, givenEnabledFtrPooledEuA0SteppingAndG10DevIdWhenCal
mySysInfo.EuCountPerPoolMin = 99999;
mySkuTable.flags.ftrPooledEuEnabled = 1;
myPlatform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
myPlatform.usDeviceID = DG2_G10_IDS[0];
myPlatform.usDeviceID = dg2G10DeviceIds[0];
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
@ -71,7 +71,7 @@ DG2TEST_F(Dg2UsDeviceIdTest, givenEnabledFtrPooledEuA0SteppingAndG10DevIdWhenCal
DG2TEST_F(Dg2UsDeviceIdTest, givenRevisionEnumThenProperMaxThreadsForWorkgroupIsReturned) {
const auto &hwInfoConfig = *HwInfoConfig::get(hardwareInfo.platform.eProductFamily);
hardwareInfo.platform.usDeviceID = DG2_G10_IDS[0];
hardwareInfo.platform.usDeviceID = dg2G10DeviceIds[0];
hardwareInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
EXPECT_EQ(64u, hwInfoConfig.getMaxThreadsForWorkgroupInDSSOrSS(hardwareInfo, 64u, 64u));