Debian Codegraph @

shared/test/unit_test/gen12lp/adln/test_product_helper_adln.cpp

raw
1 /*
2 * Copyright (C) 2022-2024 Intel Corporation
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 */
7
8 #include "shared/source/gen12lp/hw_cmds_adln.h"
9 #include "shared/source/gen12lp/hw_info_gen12lp.h"
10 #include "shared/source/helpers/compiler_product_helper.h"
11 #include "shared/source/helpers/gfx_core_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 AdlnHwInfo = ::testing::Test;
24
25 ADLNTEST_F(AdlnHwInfo, givenBoolWhenCallAdlnHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
26 static bool boolValue[]{
27 true, false};
28 HardwareInfo hwInfo = *defaultHwInfo;
29 GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
30 FeatureTable &featureTable = hwInfo.featureTable;
31 WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
32
33 uint64_t config = 0x0;
34 for (auto setParamBool : boolValue) {
35
36 gtSystemInfo = {0};
37 featureTable = {};
38 workaroundTable = {};
39 hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, nullptr);
40
41 EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency);
42 EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT);
43 EXPECT_EQ(setParamBool, featureTable.flags.ftrSVM);
44 EXPECT_EQ(setParamBool, featureTable.flags.ftrIA32eGfxPTEs);
45 EXPECT_EQ(setParamBool, featureTable.flags.ftrStandardMipTailFormat);
46 EXPECT_EQ(setParamBool, featureTable.flags.ftrTranslationTable);
47 EXPECT_EQ(setParamBool, featureTable.flags.ftrUserModeTranslationTable);
48 EXPECT_EQ(setParamBool, featureTable.flags.ftrTileMappedResource);
49 EXPECT_EQ(setParamBool, featureTable.flags.ftrFbc);
50 EXPECT_EQ(setParamBool, featureTable.flags.ftrTileY);
51 EXPECT_EQ(setParamBool, featureTable.flags.ftrAstcHdr2D);
52 EXPECT_EQ(setParamBool, featureTable.flags.ftrAstcLdr2D);
53
54 EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt);
55 EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt);
56
57 EXPECT_EQ(setParamBool, workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface);
58 EXPECT_EQ(setParamBool, workaroundTable.flags.waUntypedBufferCompression);
59 }
60 }
61
62 ADLNTEST_F(AdlnHwInfo, whenPlatformIsAdlnThenExpectSvmIsSet) {
63 const HardwareInfo &hardwareInfo = ADLN::hwInfo;
64 EXPECT_TRUE(hardwareInfo.capabilityTable.ftrSvm);
65 }
66
67 ADLNTEST_F(AdlnHwInfo, givenAdlnWhenCheckL0ThenReturnTrue) {
68 const HardwareInfo &hardwareInfo = ADLN::hwInfo;
69 EXPECT_TRUE(hardwareInfo.capabilityTable.levelZeroSupported);
70 }
71
72 using AdlnProductHelper = ProductHelperTest;
73
74 ADLNTEST_F(AdlnProductHelper, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) {
75 EXPECT_EQ(aub_stream::ProductFamily::Adln, productHelper->getAubStreamProductFamily());
76 }
77
78 ADLNTEST_F(AdlnProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) {
79 EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::ADL_N);
80 }
81
82 ADLNTEST_F(AdlnProductHelper, givenCompilerProductHelperWhenGettingOclocEnforceZebinFormatThenExpectTrue) {
83 EXPECT_TRUE(compilerProductHelper->oclocEnforceZebinFormat());
84 }
85
86 ADLNTEST_F(AdlnProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) {
87 EXPECT_TRUE(productHelper->isEvictionIfNecessaryFlagSupported());
88 }
89
90 ADLNTEST_F(AdlnProductHelper, givenProductHelperWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) {
91
92 EXPECT_FALSE(productHelper->getScmPropertyThreadArbitrationPolicySupport());
93 EXPECT_TRUE(productHelper->getScmPropertyCoherencyRequiredSupport());
94 EXPECT_FALSE(productHelper->getScmPropertyZPassAsyncComputeThreadLimitSupport());
95 EXPECT_FALSE(productHelper->getScmPropertyPixelAsyncComputeThreadLimitSupport());
96 EXPECT_FALSE(productHelper->getScmPropertyLargeGrfModeSupport());
97 EXPECT_FALSE(productHelper->getScmPropertyDevicePreemptionModeSupport());
98
99 EXPECT_FALSE(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport());
100
101 EXPECT_TRUE(productHelper->getFrontEndPropertyScratchSizeSupport());
102 EXPECT_FALSE(productHelper->getFrontEndPropertyPrivateScratchSizeSupport());
103
104 EXPECT_TRUE(productHelper->getPreemptionDbgPropertyPreemptionModeSupport());
105 EXPECT_TRUE(productHelper->getPreemptionDbgPropertyStateSipSupport());
106 EXPECT_TRUE(productHelper->getPreemptionDbgPropertyCsrSurfaceSupport());
107
108 EXPECT_FALSE(productHelper->getFrontEndPropertyComputeDispatchAllWalkerSupport());
109 EXPECT_TRUE(productHelper->getFrontEndPropertyDisableEuFusionSupport());
110 EXPECT_FALSE(productHelper->getFrontEndPropertyDisableOverDispatchSupport());
111 EXPECT_FALSE(productHelper->getFrontEndPropertySingleSliceDispatchCcsModeSupport());
112
113 EXPECT_TRUE(productHelper->getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
114 EXPECT_FALSE(productHelper->getPipelineSelectPropertySystolicModeSupport());
115 }
116
117 ADLNTEST_F(AdlnProductHelper, givenAdlnPlatformWhenAskingIfWAIsRequiredThenReturnTrue) {
118 auto hwInfo = *defaultHwInfo;
119
120 EXPECT_TRUE(productHelper->pipeControlWARequired(hwInfo));
121 }