mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Reduce scope of WAs for DG2 platforms
Related-To: NEO-7607, HSD-14010744585, HSD-14010847105 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5a82b84219
commit
0a75560d7d
@@ -82,8 +82,7 @@ bool ProductHelperHw<gfxProduct>::isAdditionalStateBaseAddressWARequired(const H
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const {
|
||||
uint32_t stepping = getSteppingFromHwRevId(hwInfo);
|
||||
return (REVISION_A0 == stepping && DG2::isG10(hwInfo));
|
||||
return DG2::isG10(hwInfo) && GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_A1, hwInfo, *this);
|
||||
}
|
||||
|
||||
template <>
|
||||
@@ -103,12 +102,15 @@ void ProductHelperHw<gfxProduct>::setForceNonCoherent(void *const statePtr, cons
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const {
|
||||
return GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this);
|
||||
return DG2::isG10(hwInfo) && GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this);
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const {
|
||||
return getSteppingFromHwRevId(hwInfo) >= REVISION_B || DG2::isG11(hwInfo) || DG2::isG12(hwInfo);
|
||||
if (DG2::isG10(hwInfo) && GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
@@ -129,12 +131,12 @@ LocalMemoryAccessMode ProductHelperHw<gfxProduct>::getDefaultLocalMemoryAccessMo
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isAllocationSizeAdjustmentRequired(const HardwareInfo &hwInfo) const {
|
||||
return GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this);
|
||||
return DG2::isG10(hwInfo) && GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this);
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isPrefetchDisablingRequired(const HardwareInfo &hwInfo) const {
|
||||
return GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this);
|
||||
return DG2::isG10(hwInfo) && GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this);
|
||||
}
|
||||
|
||||
template <>
|
||||
|
||||
@@ -22,11 +22,11 @@ const PLATFORM DG2::platform = {
|
||||
PCH_UNKNOWN,
|
||||
IGFX_XE_HPG_CORE,
|
||||
IGFX_XE_HPG_CORE,
|
||||
PLATFORM_NONE, // default init
|
||||
0, // usDeviceID
|
||||
0, // usRevId. 0 sets the stepping to A0
|
||||
0, // usDeviceID_PCH
|
||||
0, // usRevId_PCH
|
||||
PLATFORM_NONE, // default init
|
||||
dg2G10DeviceIds[0], // usDeviceID
|
||||
0, // usRevId. 0 sets the stepping to A0
|
||||
0, // usDeviceID_PCH
|
||||
0, // usRevId_PCH
|
||||
GTTYPE_UNDEFINED};
|
||||
|
||||
const RuntimeCapabilityTable DG2::capabilityTable{
|
||||
|
||||
@@ -85,22 +85,11 @@ HWTEST2_F(CommandEncodeStatesTestDg2AndLater, GivenVariousSlmTotalSizesAndSettin
|
||||
{64 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K},
|
||||
};
|
||||
|
||||
const std::vector<PreferredSlmTestValues<FamilyType>> valuesToTestForDg2AStep = {
|
||||
{0, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K},
|
||||
{16 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K},
|
||||
{32 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K},
|
||||
{64 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K},
|
||||
};
|
||||
|
||||
const std::array<REVID, 5> revs{REVISION_A0, REVISION_B, REVISION_C, REVISION_D, REVISION_K};
|
||||
auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
for (auto rev : revs) {
|
||||
hwInfo.platform.usRevId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(rev, hwInfo);
|
||||
if ((hwInfo.platform.eProductFamily == IGFX_DG2) && (rev == REVISION_A0)) {
|
||||
verifyPreferredSlmValues<FamilyType>(valuesToTestForDg2AStep, pDevice->getRootDeviceEnvironment());
|
||||
} else {
|
||||
verifyPreferredSlmValues<FamilyType>(valuesToTest, pDevice->getRootDeviceEnvironment());
|
||||
}
|
||||
verifyPreferredSlmValues<FamilyType>(valuesToTest, pDevice->getRootDeviceEnvironment());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -32,3 +32,4 @@ HWTEST_EXCLUDE_PRODUCT(SbaTest, givenStateBaseAddressAndDebugFlagSetWhenAppendEx
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHpgSbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWBPL1CachePolicy, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(GfxCoreHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperTestXeHpgCore, givenProductHelperWhenCheckTimestampWaitSupportForEventsThenReturnFalse, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(CommandEncodeStatesTestDg2AndLater, GivenVariousSlmTotalSizesAndSettingRevIDToDifferentValuesWhenSetAdditionalInfoIsCalledThenCorrectValuesAreSet_IsXeHpgCore, IGFX_DG2);
|
||||
|
||||
@@ -116,40 +116,56 @@ DG2TEST_F(ProductHelperTestDg2, givenG12DevIdWhenIsDisableOverdispatchAvailableC
|
||||
}
|
||||
|
||||
DG2TEST_F(ProductHelperTestDg2, whenAdjustingDefaultEngineTypeThenSelectEngineTypeBasedOnRevisionId) {
|
||||
auto hardwareInfo = *defaultHwInfo;
|
||||
hardwareInfo.featureTable.flags.ftrCCSNode = true;
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
hwInfo.featureTable.flags.ftrCCSNode = true;
|
||||
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
hardwareInfo.capabilityTable.defaultEngineType = defaultHwInfo->capabilityTable.defaultEngineType;
|
||||
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
|
||||
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo);
|
||||
EXPECT_EQ(aub_stream::ENGINE_RCS, hardwareInfo.capabilityTable.defaultEngineType);
|
||||
|
||||
hardwareInfo.capabilityTable.defaultEngineType = defaultHwInfo->capabilityTable.defaultEngineType;
|
||||
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hardwareInfo);
|
||||
gfxCoreHelper.adjustDefaultEngineType(&hardwareInfo);
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS, hardwareInfo.capabilityTable.defaultEngineType);
|
||||
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
|
||||
for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) {
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
hwInfo.capabilityTable.defaultEngineType = defaultHwInfo->capabilityTable.defaultEngineType;
|
||||
gfxCoreHelper.adjustDefaultEngineType(&hwInfo);
|
||||
if (DG2::isG10(hwInfo) && revision < REVISION_B) {
|
||||
EXPECT_EQ(aub_stream::ENGINE_RCS, hwInfo.capabilityTable.defaultEngineType);
|
||||
} else {
|
||||
EXPECT_EQ(aub_stream::ENGINE_CCS, hardwareInfo.capabilityTable.defaultEngineType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DG2TEST_F(ProductHelperTestDg2, givenA0OrA1SteppingWhenAskingIfWAIsRequiredThenReturnTrue) {
|
||||
DG2TEST_F(ProductHelperTestDg2, givenDg2G11OrG12WhenAskingIfMaxThreadsForWorkgroupWAIsRequiredThenReturnFalse) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
std::array<std::pair<uint32_t, bool>, 4> revisions = {
|
||||
{{REVISION_A0, true},
|
||||
{REVISION_A1, true},
|
||||
{REVISION_B, false},
|
||||
{REVISION_C, false}}};
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
|
||||
for (auto deviceId : {dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) {
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
|
||||
for (const auto &[revision, paramBool] : revisions) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
EXPECT_FALSE(productHelper.isMaxThreadsForWorkgroupWARequired(hwInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
productHelper.configureHardwareCustom(&hwInfo, nullptr);
|
||||
DG2TEST_F(ProductHelperTestDg2, givenDg2G10A0OrA1SteppingWhenAskingIfWAIsRequiredThenReturnTrue) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
|
||||
for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) {
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
|
||||
EXPECT_EQ(paramBool, productHelper.isDefaultEngineTypeAdjustmentRequired(hwInfo));
|
||||
EXPECT_EQ(paramBool, productHelper.isAllocationSizeAdjustmentRequired(hwInfo));
|
||||
EXPECT_EQ(paramBool, productHelper.isPrefetchDisablingRequired(hwInfo));
|
||||
productHelper.configureHardwareCustom(&hwInfo, nullptr);
|
||||
|
||||
auto expectedValue = DG2::isG10(hwInfo) && revision < REVISION_B;
|
||||
|
||||
EXPECT_EQ(expectedValue, productHelper.isDefaultEngineTypeAdjustmentRequired(hwInfo));
|
||||
EXPECT_EQ(expectedValue, productHelper.isAllocationSizeAdjustmentRequired(hwInfo));
|
||||
EXPECT_EQ(expectedValue, productHelper.isPrefetchDisablingRequired(hwInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/command_stream/linear_stream.h"
|
||||
#include "shared/source/command_stream/stream_properties.h"
|
||||
#include "shared/source/kernel/kernel_descriptor.h"
|
||||
#include "shared/source/xe_hpg_core/hw_cmds_dg2.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
@@ -53,6 +54,30 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgrammingStateComputeModeThenProperFieldsA
|
||||
EXPECT_TRUE(pScm->getLargeGrfMode());
|
||||
}
|
||||
|
||||
DG2TEST_F(CommandEncodeDG2Test, whenProgramComputeWalkerThenApplyL3WAForDg2G10A0) {
|
||||
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
|
||||
auto walkerCmd = FamilyType::cmdInitGpgpuWalker;
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &productHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper<ProductHelper>();
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
KernelDescriptor kernelDescriptor;
|
||||
EncodeWalkerArgs walkerArgs{KernelExecutionType::Default, true, kernelDescriptor};
|
||||
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
|
||||
for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) {
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
EncodeDispatchKernel<FamilyType>::encodeAdditionalWalkerFields(hwInfo, walkerCmd, walkerArgs);
|
||||
|
||||
if (DG2::isG10(hwInfo) && revision < REVISION_B) {
|
||||
EXPECT_TRUE(walkerCmd.getL3PrefetchDisable());
|
||||
} else {
|
||||
EXPECT_FALSE(walkerCmd.getL3PrefetchDisable());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
using Dg2SbaTest = SbaTest;
|
||||
|
||||
DG2TEST_F(Dg2SbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramCorrectL1CachePolicy) {
|
||||
|
||||
@@ -15,46 +15,23 @@
|
||||
#include "shared/test/common/mocks/mock_execution_environment.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/encoders/test_encode_dispatch_kernel_dg2_and_later.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using CommandEncodeStatesDg2Test = ::testing::Test;
|
||||
|
||||
DG2TEST_F(CommandEncodeStatesDg2Test, GivenSmallSlmTotalSizesWhenSetAdditionalInfoIsCalledThenCorrectValuesAreSet) {
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using PREFERRED_SLM_ALLOCATION_SIZE = typename INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &rootDeviceEnvironment = mockExecutionEnvironment.rootDeviceEnvironments[0];
|
||||
|
||||
auto hwInfo = rootDeviceEnvironment->getMutableHardwareInfo();
|
||||
auto &revisionId = hwInfo->platform.usRevId;
|
||||
uint32_t threadsCount = 1;
|
||||
uint32_t slmTotalSize = 0;
|
||||
|
||||
{
|
||||
revisionId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(REVISION_A0, *hwInfo);
|
||||
INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData;
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsCount, slmTotalSize, SlmPolicy::SlmPolicyNone);
|
||||
EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K, idd.getPreferredSlmAllocationSize());
|
||||
}
|
||||
{
|
||||
revisionId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(REVISION_B, *hwInfo);
|
||||
INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData;
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsCount, slmTotalSize, SlmPolicy::SlmPolicyNone);
|
||||
EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K, idd.getPreferredSlmAllocationSize());
|
||||
}
|
||||
}
|
||||
|
||||
DG2TEST_F(CommandEncodeStatesDg2Test, givenNoWorkaroundNeededWhenSelectingPreferredSlmSizePerDssThenUseDssCount) {
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using PREFERRED_SLM_ALLOCATION_SIZE = typename INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
|
||||
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &rootDeviceEnvironment = mockExecutionEnvironment.rootDeviceEnvironments[0];
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
|
||||
auto &hwInfo = *rootDeviceEnvironment->getMutableHardwareInfo();
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
|
||||
hwInfo.platform.usRevId = ProductHelper::get(productFamily)->getHwRevIdFromStepping(REVISION_B, hwInfo);
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hwInfo);
|
||||
hwInfo.gtSystemInfo.ThreadCount = 1024;
|
||||
hwInfo.gtSystemInfo.DualSubSliceCount = 8;
|
||||
hwInfo.gtSystemInfo.SubSliceCount = 2 * hwInfo.gtSystemInfo.DualSubSliceCount;
|
||||
@@ -63,28 +40,64 @@ DG2TEST_F(CommandEncodeStatesDg2Test, givenNoWorkaroundNeededWhenSelectingPrefer
|
||||
const uint32_t threadsPerThreadGroup = 7; // 18 groups will fit in one DSS
|
||||
const uint32_t slmSizePerThreadGroup = 2 * MemoryConstants::kiloByte;
|
||||
INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData;
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm);
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm);
|
||||
EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K, idd.getPreferredSlmAllocationSize());
|
||||
}
|
||||
{
|
||||
const uint32_t threadsPerThreadGroup = 8; // 16 groups will fit in one DSS
|
||||
const uint32_t slmSizePerThreadGroup = 2 * MemoryConstants::kiloByte;
|
||||
INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData;
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm);
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm);
|
||||
EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K, idd.getPreferredSlmAllocationSize());
|
||||
}
|
||||
{
|
||||
const uint32_t threadsPerThreadGroup = 9; // 14 groups will fit in one DSS
|
||||
const uint32_t slmSizePerThreadGroup = 2 * MemoryConstants::kiloByte;
|
||||
INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData;
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm);
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm);
|
||||
EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K, idd.getPreferredSlmAllocationSize());
|
||||
}
|
||||
{
|
||||
const uint32_t threadsPerThreadGroup = 50; // 2 groups will fit in one DSS
|
||||
const uint32_t slmSizePerThreadGroup = 16 * MemoryConstants::kiloByte;
|
||||
INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData;
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, *rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm);
|
||||
EncodeDispatchKernel<FamilyType>::appendAdditionalIDDFields(&idd, rootDeviceEnvironment, threadsPerThreadGroup, slmSizePerThreadGroup, SlmPolicy::SlmPolicyLargeSlm);
|
||||
EXPECT_EQ(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K, idd.getPreferredSlmAllocationSize());
|
||||
}
|
||||
}
|
||||
|
||||
DG2TEST_F(CommandEncodeStatesDg2Test, GivenVariousSlmTotalSizesAndSettingRevIDToDifferentValuesWhenSetAdditionalInfoIsCalledThenCorrectValuesAreSet) {
|
||||
using PREFERRED_SLM_ALLOCATION_SIZE = typename FamilyType::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE;
|
||||
|
||||
const std::vector<PreferredSlmTestValues<FamilyType>> valuesToTest = {
|
||||
{0, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_0K},
|
||||
{16 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_16K},
|
||||
{32 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_32K},
|
||||
// since we can't set 48KB as SLM size for workgroup, we need to ask for 64KB here.
|
||||
{64 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_64K},
|
||||
};
|
||||
|
||||
const std::vector<PreferredSlmTestValues<FamilyType>> valuesToTestForDg2G10AStep = {
|
||||
{0, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K},
|
||||
{16 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K},
|
||||
{32 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K},
|
||||
{64 * KB, PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_128K},
|
||||
};
|
||||
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) {
|
||||
for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) {
|
||||
hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo);
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
if (DG2::isG10(hwInfo) && (revision < REVISION_B)) {
|
||||
verifyPreferredSlmValues<FamilyType>(valuesToTestForDg2G10AStep, rootDeviceEnvironment);
|
||||
} else {
|
||||
verifyPreferredSlmValues<FamilyType>(valuesToTest, rootDeviceEnvironment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user