Debian Codegraph @

shared/test/unit_test/gen11/ehl/test_product_helper_ehl.cpp

raw
1 /*
2 * Copyright (C) 2019-2024 Intel Corporation
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 */
7
8 #include "shared/source/execution_environment/execution_environment.h"
9 #include "shared/source/execution_environment/root_device_environment.h"
10 #include "shared/source/gen11/hw_cmds_ehl.h"
11 #include "shared/source/helpers/compiler_product_helper.h"
12 #include "shared/source/os_interface/product_helper.h"
13 #include "shared/test/common/helpers/default_hw_info.h"
14 #include "shared/test/common/test_macros/header/per_product_test_definitions.h"
15 #include "shared/test/common/test_macros/test.h"
16 #include "shared/test/unit_test/os_interface/product_helper_tests.h"
17
18 #include "platforms.h"
19
20 using namespace NEO;
21
22 using EhlProductHelper = ProductHelperTest;
23
24 EHLTEST_F(EhlProductHelper, givenProductHelperStringThenAfterSetupResultingVmeIsDisabled) {
25 hardwareInfoSetup[productFamily](&pInHwInfo, false, 0x100040008, nullptr);
26 EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler);
27 EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcPreemption);
28 EXPECT_FALSE(pInHwInfo.capabilityTable.supportsVme);
29 }
30
31 EHLTEST_F(EhlProductHelper, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
32 bool boolValue[]{
33 true, false};
34
35 GT_SYSTEM_INFO &gtSystemInfo = pInHwInfo.gtSystemInfo;
36 FeatureTable &featureTable = pInHwInfo.featureTable;
37 WorkaroundTable &workaroundTable = pInHwInfo.workaroundTable;
38
39 for (auto setParamBool : boolValue) {
40
41 gtSystemInfo = {0};
42 featureTable = {};
43 workaroundTable = {};
44 hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, 0x100040008, nullptr);
45
46 EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
47 EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
48 EXPECT_EQ(setParamBool, featureTable.flags.ftrSVM);
49 EXPECT_EQ(setParamBool, featureTable.flags.ftrIA32eGfxPTEs);
50 EXPECT_EQ(setParamBool, featureTable.flags.ftrStandardMipTailFormat);
51 EXPECT_EQ(setParamBool, featureTable.flags.ftrDisplayYTiling);
52 EXPECT_EQ(setParamBool, featureTable.flags.ftrTranslationTable);
53 EXPECT_EQ(setParamBool, featureTable.flags.ftrUserModeTranslationTable);
54 EXPECT_EQ(setParamBool, featureTable.flags.ftrTileMappedResource);
55 EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc);
56 EXPECT_EQ(setParamBool, featureTable.flags.ftrTileY);
57 EXPECT_EQ(setParamBool, featureTable.flags.ftrAstcHdr2D);
58 EXPECT_EQ(setParamBool, featureTable.flags.ftrAstcLdr2D);
59 EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt);
60 EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidThreadLevelPreempt);
61 EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt);
62
63 EXPECT_EQ(setParamBool, workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface);
64 }
65 }
66
67 EHLTEST_F(EhlProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
68 EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::EHL);
69 }
70
71 EHLTEST_F(EhlProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
72
73 EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported());
74 }
75
76 EHLTEST_F(EhlProductHelper, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
77
78 EXPECT_TRUE(productHelper->getScmPropertyThreadArbitrationPolicySupport());
79 EXPECT_TRUE(productHelper->getScmPropertyCoherencyRequiredSupport());
80 EXPECT_FALSE(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport());
81 EXPECT_FALSE(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport());
82 EXPECT_FALSE(productHelper->getScmPropertyLargeGrfModeSupport());
83 EXPECT_FALSE(productHelper->getScmPropertyDevicePreemptionModeSupport());
84
85 EXPECT_FALSE(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
86
87 EXPECT_TRUE(productHelper->getFrontEndPropertyScratchSizeSupport());
88 EXPECT_FALSE(productHelper->getFrontEndPropertyPrivateScratchSizeSupport());
89
90 EXPECT_TRUE(productHelper->getPreemptionDbgPropertyPreemptionModeSupport());
91 EXPECT_TRUE(productHelper->getPreemptionDbgPropertyStateSipSupport());
92 EXPECT_TRUE(productHelper->getPreemptionDbgPropertyCsrSurfaceSupport());
93
94 EXPECT_FALSE(productHelper->getFrontEndPropertyComputeDispatchAllWalkerSupport());
95 EXPECT_FALSE(productHelper->getFrontEndPropertyDisableEuFusionSupport());
96 EXPECT_FALSE(productHelper->getFrontEndPropertyDisableOverDispatchSupport());
97 EXPECT_FALSE(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport());
98
99 EXPECT_TRUE(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
100 EXPECT_FALSE(productHelper->getPipelineSelectPropertySystolicModeSupport());
101 }