mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Change DG2 l1 cache policy to WB
With compiler LSC WAs this gives better performance. If debugger is active, policy will not be changed ie. will be WBP. Related-To: NEO-7003 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6118e41741
commit
8cc0177f1c
@@ -393,12 +393,12 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::isEvictionIfNecessaryFlagSupported() const {
|
||||
}
|
||||
|
||||
template <>
|
||||
const char *L1CachePolicyHelper<IGFX_UNKNOWN>::getCachingPolicyOptions() {
|
||||
const char *L1CachePolicyHelper<IGFX_UNKNOWN>::getCachingPolicyOptions(bool isDebuggerActive) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t L1CachePolicyHelper<IGFX_UNKNOWN>::getDefaultL1CachePolicy() {
|
||||
uint32_t L1CachePolicyHelper<IGFX_UNKNOWN>::getDefaultL1CachePolicy(bool isDebuggerActive) {
|
||||
return 0u;
|
||||
}
|
||||
|
||||
@@ -408,8 +408,8 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::isPrefetcherDisablingInDirectSubmissionRequir
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t L1CachePolicyHelper<IGFX_UNKNOWN>::getL1CachePolicy() {
|
||||
return L1CachePolicyHelper<IGFX_UNKNOWN>::getDefaultL1CachePolicy();
|
||||
uint32_t L1CachePolicyHelper<IGFX_UNKNOWN>::getL1CachePolicy(bool isDebuggerActive) {
|
||||
return L1CachePolicyHelper<IGFX_UNKNOWN>::getDefaultL1CachePolicy(isDebuggerActive);
|
||||
}
|
||||
|
||||
template <>
|
||||
|
||||
@@ -48,7 +48,10 @@ if(TESTS_DG2_AND_LATER)
|
||||
endif()
|
||||
|
||||
if(TESTS_DG2)
|
||||
target_sources(neo_shared_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_tests_dg2.cpp)
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_tests_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_states_dg2.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(TESTS_XE_HPG_CORE)
|
||||
|
||||
66
shared/test/unit_test/encoders/test_encode_states_dg2.cpp
Normal file
66
shared/test/unit_test/encoders/test_encode_states_dg2.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/mocks/mock_debugger.h"
|
||||
#include "shared/test/unit_test/fixtures/command_container_fixture.h"
|
||||
|
||||
#include "test_traits_common.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using CommandEncodeStatesDG2Test = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesDG2Test, givenCommandContainerWhenSetStateBaseAddressCalledThenCachePolicyIsWB, IsDG2) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
cmdContainer->dirtyHeaps = 0;
|
||||
|
||||
STATE_BASE_ADDRESS sba;
|
||||
auto gmmHelper = cmdContainer->getDevice()->getRootDeviceEnvironment().getGmmHelper();
|
||||
uint32_t statelessMocsIndex = (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
|
||||
|
||||
EncodeStateBaseAddressArgs<FamilyType> args = createDefaultEncodeStateBaseAddressArgs<FamilyType>(cmdContainer.get(), sba, statelessMocsIndex);
|
||||
|
||||
EncodeStateBaseAddress<FamilyType>::encode(args);
|
||||
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
|
||||
auto itorCmd = find<STATE_BASE_ADDRESS *>(commands.begin(), commands.end());
|
||||
ASSERT_NE(itorCmd, commands.end());
|
||||
|
||||
auto cmd = genCmdCast<STATE_BASE_ADDRESS *>(*itorCmd);
|
||||
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, cmd->getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesDG2Test, givenCommandContainerAndDebuggerActiveWhenSetStateBaseAddressCalledThenCachePolicyIsWBP, IsDG2) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
cmdContainer->dirtyHeaps = 0;
|
||||
auto debugger = new MockDebugger();
|
||||
|
||||
cmdContainer->getDevice()->getExecutionEnvironment()->rootDeviceEnvironments[0]->debugger.reset(debugger);
|
||||
STATE_BASE_ADDRESS sba;
|
||||
auto gmmHelper = cmdContainer->getDevice()->getRootDeviceEnvironment().getGmmHelper();
|
||||
uint32_t statelessMocsIndex = (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
|
||||
|
||||
EncodeStateBaseAddressArgs<FamilyType> args = createDefaultEncodeStateBaseAddressArgs<FamilyType>(cmdContainer.get(), sba, statelessMocsIndex);
|
||||
const_cast<DeviceInfo &>(pDevice->getDeviceInfo()).debuggerActive = true;
|
||||
EncodeStateBaseAddress<FamilyType>::encode(args);
|
||||
|
||||
GenCmdList commands;
|
||||
CmdParse<FamilyType>::parseCommandBuffer(commands, ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), 0), cmdContainer->getCommandStream()->getUsed());
|
||||
|
||||
auto itorCmd = find<STATE_BASE_ADDRESS *>(commands.begin(), commands.end());
|
||||
ASSERT_NE(itorCmd, commands.end());
|
||||
|
||||
auto cmd = genCmdCast<STATE_BASE_ADDRESS *>(*itorCmd);
|
||||
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, cmd->getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
@@ -13,7 +13,8 @@
|
||||
using namespace NEO;
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenL1CachePolicyHelperWhenUnsupportedL1PoliciesAndGetDefaultL1CachePolicyThenReturnZero, IsAtMostXeHpCore) {
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), 0u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), 0u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), 0u);
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenL1CachePolicyHelperWhenUnsupportedL1PoliciesAndGetUncached1CachePolicyThenReturnOne, IsAtMostXeHpCore) {
|
||||
@@ -22,7 +23,8 @@ HWTEST2_F(HwInfoConfigTest, givenL1CachePolicyHelperWhenUnsupportedL1PoliciesAnd
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetL1CachePolicyThenReturnCorrectValue, IsAtLeastXeHpgCore) {
|
||||
using GfxFamily = typename HwMapper<productFamily>::GfxFamily;
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetUncached1CachePolicyThenReturnCorrectValue, IsAtLeastXeHpgCore) {
|
||||
@@ -35,7 +37,8 @@ HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndWriteBackPolicyWhenGetL1Cach
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2);
|
||||
|
||||
const char *expectedStr = "-cl-store-cache-default=7 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(false), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(true), expectedStr, strlen(expectedStr)));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndForceAllResourcesUncachedWhenGetL1CachePolicyThenReturnCorrectValue, IsAtLeastXeHpgCore) {
|
||||
@@ -44,21 +47,26 @@ HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndForceAllResourcesUncachedWhe
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(4);
|
||||
|
||||
const char *expectedStr = "-cl-store-cache-default=1 -cl-load-cache-default=1";
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(false), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<productFamily>::getCachingPolicyOptions(true), expectedStr, strlen(expectedStr)));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenL1CachePolicyHelperWhenDebugFlagSetAndGetL1CachePolicyThenReturnCorrectValue, MatchAny) {
|
||||
DebugManagerStateRestore restorer;
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(0);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), 0u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), 0u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), 0u);
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), 2u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), 2u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), 2u);
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(3);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), 3u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), 3u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), 3u);
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(4);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(), 4u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(false), 4u);
|
||||
EXPECT_EQ(L1CachePolicyHelper<productFamily>::getL1CachePolicy(true), 4u);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,8 @@ HWTEST2_F(SbaTest, WhenAppendStateBaseAddressParametersIsCalledThenSBACmdHasBind
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::appendStateBaseAddressParameters(args, true);
|
||||
@@ -84,7 +85,8 @@ HWTEST2_F(SbaTest, WhenProgramStateBaseAddressParametersIsCalledThenSBACmdHasBin
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@@ -126,7 +128,8 @@ HWTEST2_F(SbaTest,
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
true // overrideSurfaceStateBaseAddress
|
||||
true, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@@ -168,7 +171,8 @@ HWTEST2_F(SbaForBindlessTests, givenGlobalBindlessBaseAddressWhenProgramStateBas
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@@ -223,7 +227,8 @@ HWTEST2_F(SbaForBindlessTests,
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
true // overrideSurfaceStateBaseAddress
|
||||
true, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@@ -279,7 +284,8 @@ HWTEST2_F(SbaForBindlessTests, givenGlobalBindlessBaseAddressWhenPassingIndirect
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@@ -316,7 +322,8 @@ HWTEST2_F(SbaTest, givenSbaWhenOverrideBindlessSurfaceBaseIsFalseThenBindlessSur
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::appendStateBaseAddressParameters(args, false);
|
||||
@@ -355,7 +362,8 @@ HWTEST2_F(SbaTest, givenGlobalBindlessBaseAddressWhenSshIsPassedThenBindlessSurf
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@@ -393,7 +401,8 @@ HWTEST2_F(SbaTest, givenSurfaceStateHeapWhenNotUsingGlobalHeapBaseThenBindlessSu
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
@@ -407,41 +416,110 @@ HWTEST2_F(SbaTest, givenStateBaseAddressAndDebugFlagSetWhenAppendExtraCacheSetti
|
||||
auto expectedStateBaseAddress = FamilyType::cmdInitStateBaseAddress;
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
StateBaseAddressHelperArgs<FamilyType> args = {
|
||||
0, // generalStateBase
|
||||
0, // indirectObjectHeapBaseAddress
|
||||
0, // instructionHeapBaseAddress
|
||||
0, // globalHeapsBaseAddress
|
||||
0, // surfaceStateBaseAddress
|
||||
&stateBaseAddress, // stateBaseAddressCmd
|
||||
nullptr, // dsh
|
||||
nullptr, // ioh
|
||||
&ssh, // ssh
|
||||
pDevice->getGmmHelper(), // gmmHelper
|
||||
0, // statelessMocsIndex
|
||||
MemoryCompressionState::NotApplicable, // memoryCompressionState
|
||||
false, // setInstructionStateBaseAddress
|
||||
false, // setGeneralStateBaseAddress
|
||||
false, // useGlobalHeapsBaseAddress
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(0, memcmp(&stateBaseAddress, &expectedStateBaseAddress, sizeof(STATE_BASE_ADDRESS)));
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(2);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(0, memcmp(&stateBaseAddress, &expectedStateBaseAddress, sizeof(STATE_BASE_ADDRESS)));
|
||||
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(true);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(0, memcmp(&stateBaseAddress, &expectedStateBaseAddress, sizeof(STATE_BASE_ADDRESS)));
|
||||
}
|
||||
|
||||
HWTEST2_F(SbaTest, givenStateBaseAddressAndDebugFlagSetWhenAppendExtraCacheSettingsThenProgramCorrectL1CachePolicy, IsAtLeastXeHpgCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
auto stateBaseAddress = FamilyType::cmdInitStateBaseAddress;
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
StateBaseAddressHelperArgs<FamilyType> args = {
|
||||
0, // generalStateBase
|
||||
0, // indirectObjectHeapBaseAddress
|
||||
0, // instructionHeapBaseAddress
|
||||
0, // globalHeapsBaseAddress
|
||||
0, // surfaceStateBaseAddress
|
||||
&stateBaseAddress, // stateBaseAddressCmd
|
||||
nullptr, // dsh
|
||||
nullptr, // ioh
|
||||
&ssh, // ssh
|
||||
pDevice->getGmmHelper(), // gmmHelper
|
||||
0, // statelessMocsIndex
|
||||
MemoryCompressionState::NotApplicable, // memoryCompressionState
|
||||
false, // setInstructionStateBaseAddress
|
||||
false, // setGeneralStateBaseAddress
|
||||
false, // useGlobalHeapsBaseAddress
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
{
|
||||
DebugManagerStateRestore restore;
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(2);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(2);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(3);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(3);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(4);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(4);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(true);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(&stateBaseAddress, &hardwareInfo);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(true);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
args.isDebuggerActive = true;
|
||||
{
|
||||
DebugManagerStateRestore restore;
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(2);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(3);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceStatelessL1CachingPolicy.set(4);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(true);
|
||||
StateBaseAddressHelper<FamilyType>::appendExtraCacheSettings(args);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, stateBaseAddress.getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(SbaTest, givenDebugFlagSetWhenAppendingSbaThenProgramCorrectL1CachePolicy, IsAtLeastXeHpgCore) {
|
||||
@@ -475,7 +553,8 @@ HWTEST2_F(SbaTest, givenDebugFlagSetWhenAppendingSbaThenProgramCorrectL1CachePol
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
|
||||
for (const auto &input : testInputs) {
|
||||
@@ -555,7 +634,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, SbaTest, whenGeneralStateBaseAddressIsProgrammedThen
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
|
||||
@@ -586,7 +666,8 @@ HWTEST_F(SbaTest, givenNonZeroGeneralStateBaseAddressWhenProgrammingIsDisabledTh
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
|
||||
@@ -619,7 +700,8 @@ HWTEST_F(SbaTest, givenNonZeroInternalHeapBaseAddressWhenProgrammingIsDisabledTh
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
|
||||
@@ -658,7 +740,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, SbaTest, givenSbaProgrammingWhenHeapsAreNotProvidedT
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
|
||||
@@ -717,7 +800,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, SbaTest,
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::programStateBaseAddress(args);
|
||||
|
||||
|
||||
@@ -104,13 +104,15 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsAdjustWalkOrderAvailableCallTh
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtMostXeHPWhenGetCachingPolicyOptionsThenReturnNullptr, IsAtMostXeHpCore) {
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_EQ(compilerHwInfoConfig->getCachingPolicyOptions(), nullptr);
|
||||
EXPECT_EQ(compilerHwInfoConfig->getCachingPolicyOptions(false), nullptr);
|
||||
EXPECT_EQ(compilerHwInfoConfig->getCachingPolicyOptions(true), nullptr);
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteByPassPolicyOption, IsAtLeastXeHpgCore) {
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
const char *expectedStr = "-cl-store-cache-default=2 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr)));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteBackPolicyOption, IsAtLeastXeHpgCore) {
|
||||
@@ -119,7 +121,8 @@ HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThen
|
||||
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
const char *expectedStr = "-cl-store-cache-default=7 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr)));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndDebugFlagSetForceAllResourcesUncachedWhenGetCachingPolicyOptionsThenReturnUncachedPolicyOption, IsAtLeastXeHpgCore) {
|
||||
@@ -129,7 +132,8 @@ HWTEST2_F(HwInfoConfigTest, givenAtLeastXeHpgCoreAndDebugFlagSetForceAllResource
|
||||
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
const char *expectedStr = "-cl-store-cache-default=1 -cl-load-cache-default=1";
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(false), expectedStr, strlen(expectedStr)));
|
||||
EXPECT_EQ(0, memcmp(compilerHwInfoConfig->getCachingPolicyOptions(true), expectedStr, strlen(expectedStr)));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenCachePolicyWithoutCorrespondingBuildOptionWhenGetCachingPolicyOptionsThenReturnNullptr, IsAtLeastXeHpgCore) {
|
||||
@@ -137,7 +141,8 @@ HWTEST2_F(HwInfoConfigTest, givenCachePolicyWithoutCorrespondingBuildOptionWhenG
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(5);
|
||||
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_EQ(nullptr, compilerHwInfoConfig->getCachingPolicyOptions());
|
||||
EXPECT_EQ(nullptr, compilerHwInfoConfig->getCachingPolicyOptions(false));
|
||||
EXPECT_EQ(nullptr, compilerHwInfoConfig->getCachingPolicyOptions(true));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigAndDebugFlagWhenGetL1CachePolicyThenReturnCorrectPolicy, IsAtLeastXeHpgCore) {
|
||||
@@ -146,33 +151,40 @@ HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigAndDebugFlagWhenGetL1CachePolicyThe
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(0);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(true));
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(2);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, hwInfoConfig->getL1CachePolicy(true));
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(3);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WT, hwInfoConfig->getL1CachePolicy(true));
|
||||
|
||||
DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.set(4);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WS, hwInfoConfig->getL1CachePolicy(true));
|
||||
|
||||
DebugManager.flags.ForceAllResourcesUncached.set(true);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_UC, hwInfoConfig->getL1CachePolicy(true));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenGetL1CachePolicyThenReturnWriteByPass, IsAtLeastXeHpgCore) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, hwInfoConfig->getL1CachePolicy(true));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenPlatformWithUnsupportedL1CachePoliciesWhenGetL1CachePolicyThenReturnZero, IsAtMostXeHpCore) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
|
||||
EXPECT_EQ(0u, hwInfoConfig->getL1CachePolicy());
|
||||
EXPECT_EQ(0u, hwInfoConfig->getL1CachePolicy(false));
|
||||
EXPECT_EQ(0u, hwInfoConfig->getL1CachePolicy(true));
|
||||
}
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenIsPrefetcherDisablingInDirectSubmissionRequiredThenTrueIsReturned) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
if(TESTS_XE_HP_CORE)
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_tests_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/excludes_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hp_core_tests.cpp
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/cache_flush_xehp_and_later.inl"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using L3ControlTests = ::testing::Test;
|
||||
|
||||
HWTEST2_F(L3ControlTests, givenL3ControlWhenAdjustCalledThenItIsNotChanged, IsXeHpCore) {
|
||||
using L3_CONTROL = typename FamilyType::L3_CONTROL;
|
||||
auto l3Control = FamilyType::cmdInitL3Control;
|
||||
auto l3ControlOnStart = l3Control;
|
||||
|
||||
adjustL3ControlField<FamilyType>(&l3Control);
|
||||
EXPECT_EQ(0, memcmp(&l3ControlOnStart, &l3Control, sizeof(L3_CONTROL))); // no change
|
||||
}
|
||||
@@ -11,6 +11,7 @@ if(TESTS_XE_HPG_CORE)
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${IGDRCL_SRCS_tests_xe_hpg_core_excludes}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_encoder_tests_xe_hpg_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_xe_hpg_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_cmds_xe_hpg_core_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests_xe_hpg_core.cpp
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/cache_flush_xehp_and_later.inl"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using L3ControlTests = ::testing::Test;
|
||||
|
||||
HWTEST2_F(L3ControlTests, givenL3ControlWhenAdjustCalledThenUnTypedDataPortCacheFlushIsSet, IsXeHpgCore) {
|
||||
using L3_CONTROL = typename FamilyType::L3_CONTROL;
|
||||
auto l3Control = FamilyType::cmdInitL3Control;
|
||||
auto l3ControlOnStart = l3Control;
|
||||
|
||||
adjustL3ControlField<FamilyType>(&l3Control);
|
||||
EXPECT_NE(0, memcmp(&l3ControlOnStart, &l3Control, sizeof(L3_CONTROL))); // no change
|
||||
|
||||
EXPECT_FALSE(l3ControlOnStart.getUnTypedDataPortCacheFlush());
|
||||
EXPECT_TRUE(l3Control.getUnTypedDataPortCacheFlush());
|
||||
}
|
||||
@@ -15,12 +15,16 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
DG2TEST_F(HwInfoConfigTest, givenDG2WhenGetL1CachePolicyThenReturnWbpPolicy) {
|
||||
DG2TEST_F(HwInfoConfigTest, givenDG2WhenGetL1CachePolicyThenReturnWbPolicyUnlessDebuggerIsActive) {
|
||||
using GfxFamily = typename HwMapper<IGFX_DG2>::GfxFamily;
|
||||
EXPECT_EQ(L1CachePolicyHelper<IGFX_DG2>::getL1CachePolicy(), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
EXPECT_EQ(L1CachePolicyHelper<IGFX_DG2>::getL1CachePolicy(false), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB);
|
||||
EXPECT_EQ(L1CachePolicyHelper<IGFX_DG2>::getL1CachePolicy(true), GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
}
|
||||
|
||||
DG2TEST_F(HwInfoConfigTest, givenDG2WhenGetCachingPolicyOptionsThenReturnCorrectValue) {
|
||||
const char *expectedStr = "-cl-store-cache-default=2 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<IGFX_DG2>::getCachingPolicyOptions(), expectedStr, strlen(expectedStr)));
|
||||
const char *writeBackPolicyOptions = "-cl-store-cache-default=7 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<IGFX_DG2>::getCachingPolicyOptions(false), writeBackPolicyOptions, strlen(writeBackPolicyOptions)));
|
||||
|
||||
const char *writeByPassPolicyOptions = "-cl-store-cache-default=2 -cl-load-cache-default=4";
|
||||
EXPECT_EQ(0, memcmp(L1CachePolicyHelper<IGFX_DG2>::getCachingPolicyOptions(true), writeByPassPolicyOptions, strlen(writeByPassPolicyOptions)));
|
||||
}
|
||||
@@ -18,8 +18,13 @@ HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfTile64With3
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, WhenAllowRenderCompressionIsCalledThenTrueIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, whenConvertingTimestampsToCsDomainThenNothingIsChanged, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfStorageInfoAdjustmentIsRequiredThenFalseIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetCachingPolicyOptionsThenReturnWriteByPassPolicyOption_IsAtLeastXeHpgCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenGetL1CachePolicyThenReturnWriteByPass_IsAtLeastXeHpgCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenAtLeastXeHpgCoreWhenGetL1CachePolicyThenReturnCorrectValue_IsAtLeastXeHpgCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(AILTests, whenModifyKernelIfRequiredIsCalledThenDontChangeKernelSources, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(CommandEncodeStatesTest, givenSlmTotalSizeEqualZeroWhenDispatchingKernelThenSharedMemorySizeIsSetCorrectly, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateInternalAllocationInDevicePoolThen32BitAllocationIsCreated, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenLinearStreamIsAllocatedInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateKernelIsaInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateKernelIsaInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(SbaTest, givenStateBaseAddressAndDebugFlagSetWhenAppendExtraCacheSettingsThenProgramCorrectL1CachePolicy_IsAtLeastXeHpgCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHpgSbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWBPL1CachePolicy, IGFX_DG2);
|
||||
|
||||
@@ -53,7 +53,7 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgrammingStateComputeModeThenProperFieldsA
|
||||
|
||||
using Dg2SbaTest = SbaTest;
|
||||
|
||||
DG2TEST_F(Dg2SbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWtL1CachePolicy) {
|
||||
DG2TEST_F(Dg2SbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWBL1CachePolicyUnlessDebuggerIsActive) {
|
||||
auto sbaCmd = FamilyType::cmdInitStateBaseAddress;
|
||||
StateBaseAddressHelperArgs<FamilyType> args = {
|
||||
0, // generalStateBase
|
||||
@@ -74,10 +74,14 @@ DG2TEST_F(Dg2SbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWtL1C
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
false // isDebuggerActive
|
||||
};
|
||||
StateBaseAddressHelper<FamilyType>::appendStateBaseAddressParameters(args, true);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, sbaCmd.getL1CachePolicyL1CacheControl());
|
||||
|
||||
args.isDebuggerActive = true;
|
||||
StateBaseAddressHelper<FamilyType>::appendStateBaseAddressParameters(args, true);
|
||||
EXPECT_EQ(FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, sbaCmd.getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user