Debian Codegraph @

shared/test/unit_test/gen11/icllp/test_product_helper_icllp.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_icllp.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 "aubstream/product_family.h"
19 #include "platforms.h"
20
21 using namespace NEO;
22
23 using IcllpProductHelper = ProductHelperTest;
24
25 ICLLPTEST_F(IcllpProductHelper, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) {
26
27 GT_SYSTEM_INFO &gtSystemInfo = pInHwInfo.gtSystemInfo;
28
29 uint64_t config = 0xdeadbeef;
30 gtSystemInfo = {0};
31 EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config, nullptr));
32 EXPECT_EQ(0u, gtSystemInfo.SliceCount);
33 EXPECT_EQ(0u, gtSystemInfo.SubSliceCount);
34 EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount);
35 EXPECT_EQ(0u, gtSystemInfo.EUCount);
36 }
37
38 ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenAskedIfAdditionalMediaSamplerProgrammingIsRequiredThenTrueIsReturned) {
39
40 EXPECT_TRUE(productHelper->isAdditionalMediaSamplerProgrammingRequired());
41 }
42
43 ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenAskedIfInitialFlagsProgrammingIsRequiredThenTrueIsReturned) {
44
45 EXPECT_TRUE(productHelper->isInitialFlagsProgrammingRequired());
46 }
47
48 ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenAskedIfReturnedCmdSizeForMediaSamplerAdjustmentIsRequiredThenTrueIsReturned) {
49
50 EXPECT_TRUE(productHelper->isReturnedCmdSizeForMediaSamplerAdjustmentRequired());
51 }
52
53 ICLLPTEST_F(IcllpProductHelper, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) {
54 EXPECT_EQ(aub_stream::ProductFamily::Icllp, productHelper->getAubStreamProductFamily());
55 }
56
57 ICLLPTEST_F(IcllpProductHelper, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
58 uint64_t configs[] = {
59 0x100080008,
60 0x100040008,
61 0x100060008};
62 bool boolValue[]{
63 true, false};
64
65 GT_SYSTEM_INFO &gtSystemInfo = pInHwInfo.gtSystemInfo;
66 FeatureTable &featureTable = pInHwInfo.featureTable;
67 WorkaroundTable &workaroundTable = pInHwInfo.workaroundTable;
68
69 for (auto config : configs) {
70 for (auto setParamBool : boolValue) {
71
72 gtSystemInfo = {0};
73 featureTable = {};
74 workaroundTable = {};
75 hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, config, nullptr);
76
77 EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
78 EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
79 EXPECT_EQ(setParamBool, featureTable.flags.ftrSVM);
80 EXPECT_EQ(setParamBool, featureTable.flags.ftrIA32eGfxPTEs);
81 EXPECT_EQ(setParamBool, featureTable.flags.ftrStandardMipTailFormat);
82 EXPECT_EQ(setParamBool, featureTable.flags.ftrDisplayYTiling);
83 EXPECT_EQ(setParamBool, featureTable.flags.ftrTranslationTable);
84 EXPECT_EQ(setParamBool, featureTable.flags.ftrUserModeTranslationTable);
85 EXPECT_EQ(setParamBool, featureTable.flags.ftrTileMappedResource);
86 EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc);
87 EXPECT_EQ(setParamBool, featureTable.flags.ftrTileY);
88 EXPECT_EQ(setParamBool, featureTable.flags.ftrAstcHdr2D);
89 EXPECT_EQ(setParamBool, featureTable.flags.ftrAstcLdr2D);
90 EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt);
91 EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidThreadLevelPreempt);
92 EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt);
93
94 EXPECT_EQ(setParamBool, workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface);
95 }
96 }
97 }
98
99 ICLLPTEST_F(IcllpProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
100 EXPECT_EQ(compilerProductHelper->getHwIpVersion(*defaultHwInfo), AOT::ICL);
101 }
102
103 ICLLPTEST_F(IcllpProductHelper, givenCompilerProductHelperWhenGettingOclocEnforceZebinFormatThenExpectTrue) {
104 EXPECT_TRUE(compilerProductHelper->oclocEnforceZebinFormat());
105 }
106
107 ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
108
109 EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported());
110 }
111
112 ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
113
114 EXPECT_TRUE(productHelper->getScmPropertyThreadArbitrationPolicySupport());
115 EXPECT_TRUE(productHelper->getScmPropertyCoherencyRequiredSupport());
116 EXPECT_FALSE(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport());
117 EXPECT_FALSE(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport());
118 EXPECT_FALSE(productHelper->getScmPropertyLargeGrfModeSupport());
119 EXPECT_FALSE(productHelper->getScmPropertyDevicePreemptionModeSupport());
120
121 EXPECT_FALSE(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
122
123 EXPECT_TRUE(productHelper->getFrontEndPropertyScratchSizeSupport());
124 EXPECT_FALSE(productHelper->getFrontEndPropertyPrivateScratchSizeSupport());
125
126 EXPECT_TRUE(productHelper->getPreemptionDbgPropertyPreemptionModeSupport());
127 EXPECT_TRUE(productHelper->getPreemptionDbgPropertyStateSipSupport());
128 EXPECT_TRUE(productHelper->getPreemptionDbgPropertyCsrSurfaceSupport());
129
130 EXPECT_FALSE(productHelper->getFrontEndPropertyComputeDispatchAllWalkerSupport());
131 EXPECT_FALSE(productHelper->getFrontEndPropertyDisableEuFusionSupport());
132 EXPECT_FALSE(productHelper->getFrontEndPropertyDisableOverDispatchSupport());
133 EXPECT_FALSE(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport());
134
135 EXPECT_TRUE(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
136 EXPECT_FALSE(productHelper->getPipelineSelectPropertySystolicModeSupport());
137 }