mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +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
2d949a9f3d
commit
a820e73dd7
@ -155,6 +155,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
args.gmmHelper = neoDevice->getGmmHelper();
|
||||
args.useGlobalAtomics = kernelImp->getKernelDescriptor().kernelAttributes.flags.useGlobalAtomics;
|
||||
args.areMultipleSubDevicesInContext = false;
|
||||
args.isDebuggerActive = true;
|
||||
NEO::EncodeSurfaceState<GfxFamily>::encodeBuffer(args);
|
||||
*reinterpret_cast<typename GfxFamily::RENDER_SURFACE_STATE *>(surfaceStateSpace) = surfaceState;
|
||||
}
|
||||
|
@ -275,6 +275,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
args.useGlobalAtomics = kernelImp->getKernelDescriptor().kernelAttributes.flags.useGlobalAtomics;
|
||||
args.areMultipleSubDevicesInContext = args.numAvailableDevices > 1;
|
||||
args.implicitScaling = this->partitionCount > 1;
|
||||
args.isDebuggerActive = true;
|
||||
|
||||
NEO::EncodeSurfaceState<GfxFamily>::encodeBuffer(args);
|
||||
*reinterpret_cast<typename GfxFamily::RENDER_SURFACE_STATE *>(surfaceStateSpace) = surfaceState;
|
||||
|
@ -51,6 +51,7 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
|
||||
|
||||
auto indirectObjectHeapBaseAddress = neoDevice->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), useLocalMemoryForIndirectHeap);
|
||||
auto instructionHeapBaseAddress = neoDevice->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), neoDevice->getMemoryManager()->isLocalMemoryUsedForIsa(neoDevice->getRootDeviceIndex()));
|
||||
auto isDebuggerActive = neoDevice->isDebuggerActive() || neoDevice->getDebugger() != nullptr;
|
||||
|
||||
NEO::StateBaseAddressHelperArgs<GfxFamily> stateBaseAddressHelperArgs = {
|
||||
gsba, // generalStateBase
|
||||
@ -71,7 +72,8 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
|
||||
false, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
isDebuggerActive // isDebuggerActive
|
||||
};
|
||||
|
||||
NEO::StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(stateBaseAddressHelperArgs);
|
||||
|
@ -41,6 +41,7 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
|
||||
|
||||
NEO::EncodeWA<GfxFamily>::addPipeControlBeforeStateBaseAddress(commandStream, hwInfo, isRcs);
|
||||
auto sbaCmdBuf = NEO::StateBaseAddressHelper<GfxFamily>::getSpaceForSbaCmd(commandStream);
|
||||
auto isDebuggerActive = neoDevice->isDebuggerActive() || neoDevice->getDebugger() != nullptr;
|
||||
|
||||
STATE_BASE_ADDRESS sbaCmd;
|
||||
NEO::StateBaseAddressHelperArgs<GfxFamily> stateBaseAddressHelperArgs = {
|
||||
@ -62,7 +63,8 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
|
||||
multiOsContextCapable, // isMultiOsContextCapable
|
||||
false, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
isDebuggerActive // isDebuggerActive
|
||||
};
|
||||
|
||||
NEO::StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(stateBaseAddressHelperArgs);
|
||||
|
@ -75,7 +75,7 @@ struct KernelHw : public KernelImp {
|
||||
if (l3Enabled == false) {
|
||||
this->kernelRequiresQueueUncachedMocsCount++;
|
||||
}
|
||||
|
||||
auto isDebuggerActive = neoDevice->isDebuggerActive() || neoDevice->getDebugger() != nullptr;
|
||||
NEO::EncodeSurfaceStateArgs args;
|
||||
args.outMemory = &surfaceState;
|
||||
args.graphicsAddress = bufferAddressForSsh;
|
||||
@ -87,6 +87,7 @@ struct KernelHw : public KernelImp {
|
||||
args.useGlobalAtomics = kernelImmData->getDescriptor().kernelAttributes.flags.useGlobalAtomics;
|
||||
args.areMultipleSubDevicesInContext = args.numAvailableDevices > 1;
|
||||
args.implicitScaling = device->isImplicitScalingCapable();
|
||||
args.isDebuggerActive = isDebuggerActive;
|
||||
|
||||
NEO::EncodeSurfaceState<GfxFamily>::encodeBuffer(args);
|
||||
*reinterpret_cast<typename GfxFamily::RENDER_SURFACE_STATE *>(surfaceStateAddress) = surfaceState;
|
||||
|
@ -72,7 +72,7 @@ inline void patchWithImplicitSurface(ArrayRef<uint8_t> crossThreadData, ArrayRef
|
||||
|
||||
auto &hwInfo = device.getHardwareInfo();
|
||||
auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
|
||||
auto isDebuggerActive = device.isDebuggerActive() || device.getDebugger() != nullptr;
|
||||
NEO::EncodeSurfaceStateArgs args;
|
||||
args.outMemory = surfaceState;
|
||||
args.size = sizeToPatch;
|
||||
@ -84,6 +84,7 @@ inline void patchWithImplicitSurface(ArrayRef<uint8_t> crossThreadData, ArrayRef
|
||||
args.areMultipleSubDevicesInContext = args.numAvailableDevices > 1;
|
||||
args.mocs = hwHelper.getMocsIndex(*args.gmmHelper, true, false) << 1;
|
||||
args.implicitScaling = implicitScaling;
|
||||
args.isDebuggerActive = isDebuggerActive;
|
||||
|
||||
hwHelper.encodeBufferSurfaceState(args);
|
||||
}
|
||||
|
@ -121,8 +121,8 @@ std::string ModuleTranslationUnit::generateCompilerOptions(const char *buildOpti
|
||||
}
|
||||
std::string internalOptions = NEO::CompilerOptions::concatenate(internalBuildOptions, BuildOptions::hasBufferOffsetArg);
|
||||
auto &neoDevice = *device->getNEODevice();
|
||||
|
||||
if (neoDevice.getDeviceInfo().debuggerActive) {
|
||||
auto isDebuggerActive = neoDevice.getDeviceInfo().debuggerActive;
|
||||
if (isDebuggerActive) {
|
||||
if (NEO::SourceLevelDebugger::shouldAppendOptDisable(*device->getSourceLevelDebugger())) {
|
||||
NEO::CompilerOptions::concatenateAppend(options, BuildOptions::optDisable);
|
||||
}
|
||||
@ -139,7 +139,7 @@ std::string ModuleTranslationUnit::generateCompilerOptions(const char *buildOpti
|
||||
internalOptions = NEO::CompilerOptions::concatenate(internalOptions, NEO::CompilerOptions::greaterThan4gbBuffersRequired);
|
||||
}
|
||||
|
||||
NEO::CompilerOptions::concatenateAppend(internalOptions, compilerHwInfoConfig.getCachingPolicyOptions());
|
||||
NEO::CompilerOptions::concatenateAppend(internalOptions, compilerHwInfoConfig.getCachingPolicyOptions(isDebuggerActive));
|
||||
return internalOptions;
|
||||
}
|
||||
|
||||
|
@ -2259,7 +2259,7 @@ HWTEST_F(ModuleTranslationUnitTest, givenInternalOptionsThenLSCCachePolicyIsSet)
|
||||
auto ret = moduleTu.buildFromSpirV("", 0U, nullptr, "", nullptr);
|
||||
const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_TRUE(ret);
|
||||
auto expectedPolicy = compilerHwInfoConfig.getCachingPolicyOptions();
|
||||
auto expectedPolicy = compilerHwInfoConfig.getCachingPolicyOptions(false);
|
||||
if (expectedPolicy != nullptr) {
|
||||
EXPECT_NE(pMockCompilerInterface->inputInternalOptions.find(expectedPolicy), std::string::npos);
|
||||
} else {
|
||||
|
@ -7,9 +7,11 @@
|
||||
if(TESTS_DG2)
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_sampler_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdlist_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdqueue_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_kernel_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_excludes_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_sampler_dg2.cpp
|
||||
)
|
||||
add_subdirectories()
|
||||
endif()
|
||||
|
@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
@ -30,5 +31,59 @@ HWTEST2_F(CommandQueueTestDG2, givenBindlessEnabledWhenEstimateStateBaseAddressC
|
||||
EXPECT_EQ(size, expectedSize);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandQueueTestDG2, givenBindlessEnabledWhenProgramStateBaseAddressCalledOnDG2ThenProgramCorrectL1CachePolicy, IsDG2) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.UseBindlessMode.set(1);
|
||||
|
||||
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->createBindlessHeapsHelper(neoDevice->getMemoryManager(),
|
||||
neoDevice->getNumGenericSubDevices() > 1,
|
||||
neoDevice->getRootDeviceIndex(),
|
||||
neoDevice->getDeviceBitfield());
|
||||
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS;
|
||||
ze_command_queue_desc_t desc = {};
|
||||
auto &csr = neoDevice->getGpgpuCommandStreamReceiver();
|
||||
auto commandQueue = std::make_unique<MockCommandQueueHw<gfxCoreFamily>>(device, &csr, &desc);
|
||||
void *linearStreamBuffer = alignedMalloc(4096, 0x1000);
|
||||
{
|
||||
NEO::LinearStream cmdStream(linearStreamBuffer, 4096);
|
||||
auto usedSpaceBefore = cmdStream.getUsed();
|
||||
commandQueue->programStateBaseAddress(0, false, cmdStream, false);
|
||||
auto usedSpaceAfter = cmdStream.getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(cmdStream.getCpuBase(), 0), usedSpaceAfter));
|
||||
|
||||
auto sbaItor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), sbaItor);
|
||||
auto cmdSba = genCmdCast<STATE_BASE_ADDRESS *>(*sbaItor);
|
||||
|
||||
EXPECT_EQ(STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB, cmdSba->getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
{
|
||||
const_cast<NEO::DeviceInfo &>(device->getDeviceInfo()).debuggerActive = true;
|
||||
NEO::LinearStream cmdStream(linearStreamBuffer, 4096);
|
||||
auto usedSpaceBefore = cmdStream.getUsed();
|
||||
commandQueue->programStateBaseAddress(0, false, cmdStream, false);
|
||||
auto usedSpaceAfter = cmdStream.getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(cmdStream.getCpuBase(), 0), usedSpaceAfter));
|
||||
|
||||
auto sbaItor = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), sbaItor);
|
||||
auto cmdSba = genCmdCast<STATE_BASE_ADDRESS *>(*sbaItor);
|
||||
|
||||
EXPECT_EQ(STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP, cmdSba->getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
|
||||
alignedFree(linearStreamBuffer);
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
||||
|
@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/test_macros/hw_test_base.h"
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(ModuleTranslationUnitTest, givenAtLeastXeHpgCoreWhenGetInternalOptionsThenCorrectBuildOptionIsSet_IsAtLeastXeHpgCore, IGFX_DG2);
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "level_zero/core/test/unit_tests/fixtures/module_fixture.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_cmdqueue.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
using KernelTestDG2 = Test<ModuleFixture>;
|
||||
|
||||
HWTEST2_F(KernelTestDG2, givenKernelImpWhenSetBufferSurfaceStateCalledThenProgramCorrectL1CachePolicy, IsDG2) {
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
ze_kernel_handle_t kernelHandle;
|
||||
|
||||
ze_kernel_desc_t kernelDesc = {};
|
||||
kernelDesc.pKernelName = kernelName.c_str();
|
||||
|
||||
ze_result_t res = module->createKernel(&kernelDesc, &kernelHandle);
|
||||
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
|
||||
auto kernelImp = reinterpret_cast<L0::KernelImp *>(L0::Kernel::fromHandle(kernelHandle));
|
||||
|
||||
void *devicePtr = nullptr;
|
||||
ze_device_mem_alloc_desc_t deviceDesc = {};
|
||||
res = context->allocDeviceMem(device->toHandle(),
|
||||
&deviceDesc,
|
||||
16384u,
|
||||
0u,
|
||||
&devicePtr);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
|
||||
auto gpuAlloc = device->getDriverHandle()->getSvmAllocsManager()->getSVMAllocs()->get(devicePtr)->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
ASSERT_NE(nullptr, gpuAlloc);
|
||||
|
||||
uint32_t argIndex = 0u;
|
||||
kernelImp->setBufferSurfaceState(argIndex, devicePtr, gpuAlloc);
|
||||
|
||||
auto argInfo = kernelImp->getImmutableData()->getDescriptor().payloadMappings.explicitArgs[argIndex].as<NEO::ArgDescPointer>();
|
||||
auto surfaceStateAddressRaw = ptrOffset(kernelImp->getSurfaceStateHeapData(), argInfo.bindful);
|
||||
auto surfaceStateAddress = reinterpret_cast<RENDER_SURFACE_STATE *>(const_cast<unsigned char *>(surfaceStateAddressRaw));
|
||||
EXPECT_EQ(RENDER_SURFACE_STATE::L1_CACHE_POLICY_WB, surfaceStateAddress->getL1CachePolicyL1CacheControl());
|
||||
|
||||
const_cast<NEO::DeviceInfo &>(device->getDeviceInfo()).debuggerActive = true;
|
||||
kernelImp->setBufferSurfaceState(argIndex, devicePtr, gpuAlloc);
|
||||
surfaceStateAddressRaw = ptrOffset(kernelImp->getSurfaceStateHeapData(), argInfo.bindful);
|
||||
surfaceStateAddress = reinterpret_cast<RENDER_SURFACE_STATE *>(const_cast<unsigned char *>(surfaceStateAddressRaw));
|
||||
EXPECT_EQ(RENDER_SURFACE_STATE::L1_CACHE_POLICY_WBP, surfaceStateAddress->getL1CachePolicyL1CacheControl());
|
||||
|
||||
Kernel::fromHandle(kernelHandle)->destroy();
|
||||
|
||||
context->freeMem(devicePtr);
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
@ -46,14 +46,14 @@ HWTEST2_F(KernelPropertyTest, givenKernelExtendedPropertiesStructureWhenKernelPr
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp64Flags & FP_ATOMIC_EXT_FLAG_LOCAL_MIN_MAX);
|
||||
}
|
||||
|
||||
HWTEST2_F(KernelPropertyTest, givenDG2WhenGetInternalOptionsThenWriteByPassBuildOptionIsSet, IsDG2) {
|
||||
HWTEST2_F(KernelPropertyTest, givenDG2WhenGetInternalOptionsThenWriteBackBuildOptionIsSet, IsDG2) {
|
||||
auto pMockCompilerInterface = new MockCompilerInterface;
|
||||
auto &rootDeviceEnvironment = this->neoDevice->executionEnvironment->rootDeviceEnvironments[this->neoDevice->getRootDeviceIndex()];
|
||||
rootDeviceEnvironment->compilerInterface.reset(pMockCompilerInterface);
|
||||
MockModuleTranslationUnit moduleTu(this->device);
|
||||
auto ret = moduleTu.buildFromSpirV("", 0U, nullptr, "", nullptr);
|
||||
EXPECT_TRUE(ret);
|
||||
EXPECT_NE(pMockCompilerInterface->inputInternalOptions.find("-cl-store-cache-default=2 -cl-load-cache-default=4"), std::string::npos);
|
||||
EXPECT_NE(pMockCompilerInterface->inputInternalOptions.find("-cl-store-cache-default=7 -cl-load-cache-default=4"), std::string::npos);
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
|
@ -30,6 +30,7 @@ void BufferHw<GfxFamily>::setArgStateful(void *memory, bool forceNonAuxMode, boo
|
||||
auto rootDeviceIndex = device.getRootDeviceIndex();
|
||||
auto graphicsAllocation = multiGraphicsAllocation.getGraphicsAllocation(rootDeviceIndex);
|
||||
const auto isReadOnly = isValueSet(getFlags(), CL_MEM_READ_ONLY) || isReadOnlyArgument;
|
||||
auto isDebuggerActive = device.isDebuggerActive() || device.getDebugger() != nullptr;
|
||||
|
||||
NEO::EncodeSurfaceStateArgs args;
|
||||
args.outMemory = memory;
|
||||
@ -45,6 +46,7 @@ void BufferHw<GfxFamily>::setArgStateful(void *memory, bool forceNonAuxMode, boo
|
||||
args.useGlobalAtomics = useGlobalAtomics;
|
||||
args.areMultipleSubDevicesInContext = areMultipleSubDevicesInContext;
|
||||
args.implicitScaling = ImplicitScalingHelper::isImplicitScalingEnabled(device.getDeviceBitfield(), true);
|
||||
args.isDebuggerActive = isDebuggerActive;
|
||||
appendSurfaceStateArgs(args);
|
||||
EncodeSurfaceState<GfxFamily>::encodeBuffer(args);
|
||||
}
|
||||
|
@ -105,7 +105,8 @@ std::string Program::getInternalOptions() const {
|
||||
}
|
||||
|
||||
CompilerOptions::concatenateAppend(internalOptions, CompilerOptions::preserveVec3Type);
|
||||
CompilerOptions::concatenateAppend(internalOptions, compilerHwInfoConfig.getCachingPolicyOptions());
|
||||
auto isDebuggerActive = pClDevice->getDevice().isDebuggerActive() || pClDevice->getDevice().getDebugger() != nullptr;
|
||||
CompilerOptions::concatenateAppend(internalOptions, compilerHwInfoConfig.getCachingPolicyOptions(isDebuggerActive));
|
||||
return internalOptions;
|
||||
}
|
||||
|
||||
|
@ -1743,7 +1743,7 @@ TEST_F(ProgramTests, whenGetInternalOptionsThenLSCPolicyIsSet) {
|
||||
MockProgram program(pContext, false, toClDeviceVector(*pClDevice));
|
||||
auto internalOptions = program.getInternalOptions();
|
||||
const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
auto expectedPolicy = compilerHwInfoConfig.getCachingPolicyOptions();
|
||||
auto expectedPolicy = compilerHwInfoConfig.getCachingPolicyOptions(false);
|
||||
if (expectedPolicy != nullptr) {
|
||||
EXPECT_TRUE(CompilerOptions::contains(internalOptions, expectedPolicy));
|
||||
} else {
|
||||
|
@ -12,3 +12,7 @@ HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTestXeHpAndLater, givenXeHPAndLaterPlatformWh
|
||||
HWTEST_EXCLUDE_PRODUCT(WddmMemoryManagerSimpleTest, givenLinearStreamWhenItIsAllocatedThenItIsInLocalMemoryHasCpuPointerAndHasStandardHeap64kbAsGpuAddress, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwHelperTestXeHPAndLater, GiveCcsNodeThenDefaultEngineTypeIsCcs, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHPAndLaterDeviceCapsTests, givenHwInfoWhenRequestedComputeUnitsUsedForScratchThenReturnValidValue, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProgramTests, givenAtLeastXeHpgCoreWhenGetInternalOptionsThenCorrectBuildOptionIsSet_IsAtLeastXeHpgCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(CmdsProgrammingTestsXeHpgCore, givenL3ToL1DebugFlagWhenStatelessMocsIsProgrammedThenItHasL1CachingOn, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(CmdsProgrammingTestsXeHpgCore, givenAlignedCacheableReadOnlyBufferThenChoseOclBufferConstPolicy, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(CmdsProgrammingTestsXeHpgCore, whenAppendingRssThenProgramWBPL1CachePolicy, IGFX_DG2);
|
||||
|
@ -37,10 +37,27 @@ DG2TEST_F(CmdsProgrammingTestsDg2, givenL3ToL1DebugFlagWhenStatelessMocsIsProgra
|
||||
|
||||
auto stateBaseAddress = static_cast<STATE_BASE_ADDRESS *>(hwParserCsr.cmdStateBaseAddress);
|
||||
|
||||
auto actualL1CachePolocy = static_cast<uint8_t>(stateBaseAddress->getL1CachePolicyL1CacheControl());
|
||||
EXPECT_EQ(stateBaseAddress->getL1CachePolicyL1CacheControl(), STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB);
|
||||
}
|
||||
|
||||
const uint8_t expectedL1CachePolicy = FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP;
|
||||
EXPECT_EQ(expectedL1CachePolicy, actualL1CachePolocy);
|
||||
DG2TEST_F(CmdsProgrammingTestsDg2, givenL3ToL1DebugFlagAndDebuggerActiveWhenStatelessMocsIsProgrammedThenItHasCorrectL1CachingOn) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.ForceL1Caching.set(1u);
|
||||
pDevice->setDebuggerActive(true);
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
flushTask(commandStreamReceiver);
|
||||
|
||||
HardwareParse hwParserCsr;
|
||||
hwParserCsr.parseCommands<FamilyType>(commandStreamReceiver.commandStream, 0);
|
||||
hwParserCsr.findHardwareCommands<FamilyType>();
|
||||
ASSERT_NE(nullptr, hwParserCsr.cmdStateBaseAddress);
|
||||
|
||||
auto stateBaseAddress = static_cast<STATE_BASE_ADDRESS *>(hwParserCsr.cmdStateBaseAddress);
|
||||
|
||||
EXPECT_EQ(stateBaseAddress->getL1CachePolicyL1CacheControl(), STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP);
|
||||
}
|
||||
|
||||
DG2TEST_F(CmdsProgrammingTestsDg2, whenAppendingRssThenProgramWBPL1CachePolicy) {
|
||||
@ -69,7 +86,10 @@ DG2TEST_F(CmdsProgrammingTestsDg2, whenAppendingRssThenProgramWBPL1CachePolicy)
|
||||
args.areMultipleSubDevicesInContext = true;
|
||||
|
||||
EncodeSurfaceState<FamilyType>::encodeBuffer(args);
|
||||
EXPECT_EQ(FamilyType::RENDER_SURFACE_STATE::L1_CACHE_POLICY_WB, rssCmd.getL1CachePolicyL1CacheControl());
|
||||
|
||||
args.isDebuggerActive = true;
|
||||
EncodeSurfaceState<FamilyType>::encodeBuffer(args);
|
||||
EXPECT_EQ(FamilyType::RENDER_SURFACE_STATE::L1_CACHE_POLICY_WBP, rssCmd.getL1CachePolicyL1CacheControl());
|
||||
}
|
||||
|
||||
@ -95,10 +115,35 @@ DG2TEST_F(CmdsProgrammingTestsDg2, givenAlignedCacheableReadOnlyBufferThenChoseO
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
|
||||
auto actualL1CachePolocy = static_cast<uint8_t>(surfaceState.getL1CachePolicyL1CacheControl());
|
||||
EXPECT_EQ(surfaceState.getL1CachePolicyL1CacheControl(), FamilyType::RENDER_SURFACE_STATE::L1_CACHE_POLICY_WB);
|
||||
|
||||
const uint8_t expectedL1CachePolicy = FamilyType::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP;
|
||||
EXPECT_EQ(expectedL1CachePolicy, actualL1CachePolocy);
|
||||
alignedFree(ptr);
|
||||
}
|
||||
|
||||
DG2TEST_F(CmdsProgrammingTestsDg2, givenAlignedCacheableReadOnlyBufferAndDebuggerActiveWhenBufferCreateThenChoseOclBufferConstPolicy) {
|
||||
MockContext context;
|
||||
const_cast<DeviceInfo &>(context.getDevice(0)->getDevice().getDeviceInfo()).debuggerActive = true;
|
||||
const auto size = MemoryConstants::pageSize;
|
||||
const auto ptr = (void *)alignedMalloc(size * 2, MemoryConstants::pageSize);
|
||||
const auto flags = CL_MEM_USE_HOST_PTR | CL_MEM_READ_ONLY;
|
||||
|
||||
auto retVal = CL_SUCCESS;
|
||||
auto buffer = std::unique_ptr<Buffer>(Buffer::create(
|
||||
&context,
|
||||
flags,
|
||||
size,
|
||||
ptr,
|
||||
retVal));
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
typename FamilyType::RENDER_SURFACE_STATE surfaceState = {};
|
||||
buffer->setArgStateful(&surfaceState, false, false, false, false, context.getDevice(0)->getDevice(), false, false);
|
||||
|
||||
const auto expectedMocs = context.getDevice(0)->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST);
|
||||
const auto actualMocs = surfaceState.getMemoryObjectControlState();
|
||||
EXPECT_EQ(expectedMocs, actualMocs);
|
||||
|
||||
EXPECT_EQ(surfaceState.getL1CachePolicyL1CacheControl(), FamilyType::RENDER_SURFACE_STATE::L1_CACHE_POLICY_WBP);
|
||||
|
||||
alignedFree(ptr);
|
||||
}
|
||||
|
@ -779,7 +779,7 @@ void OfflineCompiler::appendExtraInternalOptions(std::string &internalOptions) {
|
||||
if (compilerHwInfoConfig.isForceEmuInt32DivRemSPRequired()) {
|
||||
CompilerOptions::concatenateAppend(internalOptions, CompilerOptions::forceEmuInt32DivRemSP);
|
||||
}
|
||||
CompilerOptions::concatenateAppend(internalOptions, compilerHwInfoConfig.getCachingPolicyOptions());
|
||||
CompilerOptions::concatenateAppend(internalOptions, compilerHwInfoConfig.getCachingPolicyOptions(false));
|
||||
}
|
||||
|
||||
void OfflineCompiler::parseDebugSettings() {
|
||||
|
@ -283,7 +283,7 @@ struct EncodeSurfaceState {
|
||||
static void encodeBuffer(EncodeSurfaceStateArgs &args);
|
||||
static void encodeExtraBufferParams(EncodeSurfaceStateArgs &args);
|
||||
static void encodeImplicitScalingParams(const EncodeSurfaceStateArgs &args);
|
||||
static void encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const HardwareInfo &hwInfo);
|
||||
static void encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const EncodeSurfaceStateArgs &args);
|
||||
static void appendBufferSurfaceState(EncodeSurfaceStateArgs &args);
|
||||
|
||||
static constexpr uintptr_t getSurfaceBaseAddressAlignmentMask() {
|
||||
|
@ -467,7 +467,7 @@ size_t EncodeSurfaceState<Family>::pushBindingTableAndSurfaceStates(IndirectHeap
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
inline void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const HardwareInfo &hwInfo) {}
|
||||
inline void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const EncodeSurfaceStateArgs &args) {}
|
||||
|
||||
template <typename Family>
|
||||
void EncodeSurfaceState<Family>::setImageAuxParamsForCCS(R_SURFACE_STATE *surfaceState, Gmm *gmm) {
|
||||
|
@ -371,6 +371,7 @@ void EncodeStateBaseAddress<Family>::encode(EncodeStateBaseAddressArgs<Family> &
|
||||
auto dsh = args.container->isHeapDirty(HeapType::DYNAMIC_STATE) ? args.container->getIndirectHeap(HeapType::DYNAMIC_STATE) : nullptr;
|
||||
auto ioh = args.container->isHeapDirty(HeapType::INDIRECT_OBJECT) ? args.container->getIndirectHeap(HeapType::INDIRECT_OBJECT) : nullptr;
|
||||
auto ssh = args.container->isHeapDirty(HeapType::SURFACE_STATE) ? args.container->getIndirectHeap(HeapType::SURFACE_STATE) : nullptr;
|
||||
auto isDebuggerActive = device.isDebuggerActive() || device.getDebugger() != nullptr;
|
||||
|
||||
StateBaseAddressHelperArgs<Family> stateBaseAddressHelperArgs = {
|
||||
0, // generalStateBase
|
||||
@ -391,7 +392,8 @@ void EncodeStateBaseAddress<Family>::encode(EncodeStateBaseAddressArgs<Family> &
|
||||
false, // isMultiOsContextCapable
|
||||
args.useGlobalAtomics, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
isDebuggerActive // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<Family>::programStateBaseAddress(stateBaseAddressHelperArgs);
|
||||
@ -457,7 +459,7 @@ inline void EncodeWA<GfxFamily>::adjustCompressionFormatForPlanarImage(uint32_t
|
||||
template <typename GfxFamily>
|
||||
inline void EncodeSurfaceState<GfxFamily>::encodeExtraBufferParams(EncodeSurfaceStateArgs &args) {
|
||||
auto surfaceState = reinterpret_cast<R_SURFACE_STATE *>(args.outMemory);
|
||||
encodeExtraCacheSettings(surfaceState, *args.gmmHelper->getHardwareInfo());
|
||||
encodeExtraCacheSettings(surfaceState, args);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
@ -13,16 +13,16 @@
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const HardwareInfo &hwInfo) {
|
||||
void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const EncodeSurfaceStateArgs &args) {
|
||||
using L1_CACHE_POLICY = typename R_SURFACE_STATE::L1_CACHE_POLICY;
|
||||
const auto &hwInfo = *args.gmmHelper->getHardwareInfo();
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
auto cachePolicy = static_cast<L1_CACHE_POLICY>(hwInfoConfig->getL1CachePolicy());
|
||||
surfaceState->setL1CachePolicyL1CacheControl(cachePolicy);
|
||||
|
||||
auto cachePolicy = static_cast<L1_CACHE_POLICY>(hwInfoConfig->getL1CachePolicy(args.isDebuggerActive));
|
||||
if (DebugManager.flags.OverrideL1CacheControlInSurfaceState.get() != -1 &&
|
||||
DebugManager.flags.ForceAllResourcesUncached.get() == false) {
|
||||
surfaceState->setL1CachePolicyL1CacheControl(static_cast<L1_CACHE_POLICY>(DebugManager.flags.OverrideL1CacheControlInSurfaceState.get()));
|
||||
cachePolicy = static_cast<L1_CACHE_POLICY>(DebugManager.flags.OverrideL1CacheControlInSurfaceState.get());
|
||||
}
|
||||
surfaceState->setL1CachePolicyL1CacheControl(cachePolicy);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
@ -473,11 +473,13 @@ void EncodeStateBaseAddress<Family>::setSbaAddressesForDebugger(NEO::Debugger::S
|
||||
|
||||
template <typename Family>
|
||||
void EncodeStateBaseAddress<Family>::encode(EncodeStateBaseAddressArgs<Family> &args) {
|
||||
auto gmmHelper = args.container->getDevice()->getRootDeviceEnvironment().getGmmHelper();
|
||||
auto &device = *args.container->getDevice();
|
||||
auto gmmHelper = device.getRootDeviceEnvironment().getGmmHelper();
|
||||
|
||||
auto dsh = args.container->isHeapDirty(HeapType::DYNAMIC_STATE) ? args.container->getIndirectHeap(HeapType::DYNAMIC_STATE) : nullptr;
|
||||
auto ioh = args.container->isHeapDirty(HeapType::INDIRECT_OBJECT) ? args.container->getIndirectHeap(HeapType::INDIRECT_OBJECT) : nullptr;
|
||||
auto ssh = args.container->isHeapDirty(HeapType::SURFACE_STATE) ? args.container->getIndirectHeap(HeapType::SURFACE_STATE) : nullptr;
|
||||
auto isDebuggerActive = device.isDebuggerActive() || device.getDebugger() != nullptr;
|
||||
|
||||
StateBaseAddressHelperArgs<Family> stateBaseAddressHelperArgs = {
|
||||
0, // generalStateBase
|
||||
@ -498,7 +500,8 @@ void EncodeStateBaseAddress<Family>::encode(EncodeStateBaseAddressArgs<Family> &
|
||||
args.multiOsContextCapable, // isMultiOsContextCapable
|
||||
args.useGlobalAtomics, // useGlobalAtomics
|
||||
false, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
isDebuggerActive // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<Family>::programStateBaseAddress(stateBaseAddressHelperArgs);
|
||||
@ -506,7 +509,7 @@ void EncodeStateBaseAddress<Family>::encode(EncodeStateBaseAddressArgs<Family> &
|
||||
auto cmdSpace = StateBaseAddressHelper<Family>::getSpaceForSbaCmd(*args.container->getCommandStream());
|
||||
*cmdSpace = args.sbaCmd;
|
||||
|
||||
auto &hwInfo = args.container->getDevice()->getHardwareInfo();
|
||||
auto &hwInfo = device.getHardwareInfo();
|
||||
auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
if (hwInfoConfig.isAdditionalStateBaseAddressWARequired(hwInfo)) {
|
||||
cmdSpace = StateBaseAddressHelper<Family>::getSpaceForSbaCmd(*args.container->getCommandStream());
|
||||
@ -630,7 +633,7 @@ void EncodeSurfaceState<Family>::encodeExtraBufferParams(EncodeSurfaceStateArgs
|
||||
surfaceState->setMemoryObjectControlState(args.gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST));
|
||||
}
|
||||
|
||||
encodeExtraCacheSettings(surfaceState, *args.gmmHelper->getHardwareInfo());
|
||||
encodeExtraCacheSettings(surfaceState, args);
|
||||
|
||||
encodeImplicitScalingParams(args);
|
||||
|
||||
|
@ -31,6 +31,7 @@ struct EncodeSurfaceStateArgsBase {
|
||||
bool useGlobalAtomics = false;
|
||||
bool areMultipleSubDevicesInContext = false;
|
||||
bool implicitScaling = false;
|
||||
bool isDebuggerActive = false;
|
||||
|
||||
protected:
|
||||
EncodeSurfaceStateArgsBase() = default;
|
||||
|
@ -428,7 +428,8 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
isMultiOsContextCapable(), // isMultiOsContextCapable
|
||||
dispatchFlags.useGlobalAtomics, // useGlobalAtomics
|
||||
dispatchFlags.areMultipleSubDevicesInContext, // areMultipleSubDevicesInContext
|
||||
false // overrideSurfaceStateBaseAddress
|
||||
false, // overrideSurfaceStateBaseAddress
|
||||
debuggingEnabled || device.isDebuggerActive() // isDebuggerActive
|
||||
};
|
||||
|
||||
StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(args);
|
||||
|
@ -21,13 +21,13 @@ bool isL3Capable(const GraphicsAllocation &graphicsAllocation);
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
struct L1CachePolicyHelper {
|
||||
|
||||
static const char *getCachingPolicyOptions();
|
||||
static const char *getCachingPolicyOptions(bool isDebuggerActive);
|
||||
|
||||
static uint32_t getDefaultL1CachePolicy();
|
||||
static uint32_t getDefaultL1CachePolicy(bool isDebuggerActive);
|
||||
|
||||
static uint32_t getUncachedL1CachePolicy();
|
||||
|
||||
static uint32_t getL1CachePolicy();
|
||||
static uint32_t getL1CachePolicy(bool isDebuggerActive);
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -12,14 +12,14 @@
|
||||
namespace NEO {
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getL1CachePolicy() {
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getL1CachePolicy(bool isDebuggerActive) {
|
||||
if (DebugManager.flags.ForceAllResourcesUncached.get()) {
|
||||
return L1CachePolicyHelper<gfxProduct>::getUncachedL1CachePolicy();
|
||||
}
|
||||
if (DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.get() != -1) {
|
||||
return DebugManager.flags.OverrideL1CachePolicyInSurfaceStateAndStateless.get();
|
||||
}
|
||||
return L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy();
|
||||
return L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy(isDebuggerActive);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
@ -11,12 +11,12 @@
|
||||
namespace NEO {
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
const char *L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions() {
|
||||
const char *L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions(bool isDebuggerActive) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy() {
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy(bool isDebuggerActive) {
|
||||
return 0u;
|
||||
}
|
||||
|
||||
|
@ -12,14 +12,14 @@
|
||||
namespace NEO {
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
const char *L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions() {
|
||||
const char *L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions(bool isDebuggerActive) {
|
||||
using GfxFamily = typename HwMapper<gfxProduct>::GfxFamily;
|
||||
|
||||
static constexpr const char *writeBackCachingPolicy = "-cl-store-cache-default=7 -cl-load-cache-default=4";
|
||||
static constexpr const char *writeByPassCachingPolicy = "-cl-store-cache-default=2 -cl-load-cache-default=4";
|
||||
static constexpr const char *uncachedCachingPolicy = "-cl-store-cache-default=1 -cl-load-cache-default=1";
|
||||
|
||||
switch (L1CachePolicyHelper<gfxProduct>::getL1CachePolicy()) {
|
||||
switch (L1CachePolicyHelper<gfxProduct>::getL1CachePolicy(isDebuggerActive)) {
|
||||
case GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP:
|
||||
return writeByPassCachingPolicy;
|
||||
case GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB:
|
||||
@ -32,7 +32,7 @@ const char *L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions() {
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy() {
|
||||
uint32_t L1CachePolicyHelper<gfxProduct>::getDefaultL1CachePolicy(bool isDebuggerActive) {
|
||||
using GfxFamily = typename HwMapper<gfxProduct>::GfxFamily;
|
||||
return GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class CompilerHwInfoConfig {
|
||||
virtual bool isForceToStatelessRequired() const = 0;
|
||||
virtual void adjustHwInfoForIgc(HardwareInfo &hwInfo) const = 0;
|
||||
virtual void setProductConfigForHwInfo(HardwareInfo &hwInfo, AheadOfTimeConfig config) const = 0;
|
||||
virtual const char *getCachingPolicyOptions() const = 0;
|
||||
virtual const char *getCachingPolicyOptions(bool isDebuggerActive) const = 0;
|
||||
};
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
@ -47,7 +47,7 @@ class CompilerHwInfoConfigHw : public CompilerHwInfoConfig {
|
||||
bool isForceToStatelessRequired() const override;
|
||||
void adjustHwInfoForIgc(HardwareInfo &hwInfo) const override;
|
||||
void setProductConfigForHwInfo(HardwareInfo &hwInfo, AheadOfTimeConfig config) const override;
|
||||
const char *getCachingPolicyOptions() const override;
|
||||
const char *getCachingPolicyOptions(bool isDebuggerActive) const override;
|
||||
|
||||
protected:
|
||||
CompilerHwInfoConfigHw() = default;
|
||||
|
@ -26,8 +26,8 @@ void CompilerHwInfoConfigHw<gfxProduct>::adjustHwInfoForIgc(HardwareInfo &hwInfo
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
const char *CompilerHwInfoConfigHw<gfxProduct>::getCachingPolicyOptions() const {
|
||||
return L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions();
|
||||
const char *CompilerHwInfoConfigHw<gfxProduct>::getCachingPolicyOptions(bool isDebuggerActive) const {
|
||||
return L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions(isDebuggerActive);
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -45,6 +45,7 @@ struct StateBaseAddressHelperArgs {
|
||||
bool useGlobalAtomics = false;
|
||||
bool areMultipleSubDevicesInContext = false;
|
||||
bool overrideSurfaceStateBaseAddress = false;
|
||||
bool isDebuggerActive = false;
|
||||
};
|
||||
|
||||
template <typename GfxFamily>
|
||||
@ -60,7 +61,7 @@ struct StateBaseAddressHelper {
|
||||
static void appendStateBaseAddressParameters(StateBaseAddressHelperArgs<GfxFamily> &args,
|
||||
bool overrideBindlessSurfaceStateBase);
|
||||
|
||||
static void appendExtraCacheSettings(STATE_BASE_ADDRESS *stateBaseAddress, const HardwareInfo *hwInfo);
|
||||
static void appendExtraCacheSettings(StateBaseAddressHelperArgs<GfxFamily> &args);
|
||||
|
||||
static void programBindingTableBaseAddress(LinearStream &commandStream, const IndirectHeap &ssh, GmmHelper *gmmHelper);
|
||||
|
||||
|
@ -29,6 +29,6 @@ void StateBaseAddressHelper<GfxFamily>::appendIohParameters(StateBaseAddressHelp
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void StateBaseAddressHelper<GfxFamily>::appendExtraCacheSettings(STATE_BASE_ADDRESS *stateBaseAddress, const HardwareInfo *hwInfo) {}
|
||||
void StateBaseAddressHelper<GfxFamily>::appendExtraCacheSettings(StateBaseAddressHelperArgs<GfxFamily> &args) {}
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -6,13 +6,13 @@
|
||||
*/
|
||||
|
||||
template <typename GfxFamily>
|
||||
void StateBaseAddressHelper<GfxFamily>::appendExtraCacheSettings(STATE_BASE_ADDRESS *stateBaseAddress, const HardwareInfo *hwInfo) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(hwInfo->platform.eProductFamily);
|
||||
auto cachePolicy = hwInfoConfig->getL1CachePolicy();
|
||||
stateBaseAddress->setL1CachePolicyL1CacheControl(static_cast<typename STATE_BASE_ADDRESS::L1_CACHE_POLICY>(cachePolicy));
|
||||
void StateBaseAddressHelper<GfxFamily>::appendExtraCacheSettings(StateBaseAddressHelperArgs<GfxFamily> &args) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(args.gmmHelper->getHardwareInfo()->platform.eProductFamily);
|
||||
auto cachePolicy = hwInfoConfig->getL1CachePolicy(args.isDebuggerActive);
|
||||
args.stateBaseAddressCmd->setL1CachePolicyL1CacheControl(static_cast<typename STATE_BASE_ADDRESS::L1_CACHE_POLICY>(cachePolicy));
|
||||
|
||||
if (DebugManager.flags.ForceStatelessL1CachingPolicy.get() != -1 &&
|
||||
DebugManager.flags.ForceAllResourcesUncached.get() == false) {
|
||||
stateBaseAddress->setL1CachePolicyL1CacheControl(static_cast<typename STATE_BASE_ADDRESS::L1_CACHE_POLICY>(DebugManager.flags.ForceStatelessL1CachingPolicy.get()));
|
||||
args.stateBaseAddressCmd->setL1CachePolicyL1CacheControl(static_cast<typename STATE_BASE_ADDRESS::L1_CACHE_POLICY>(DebugManager.flags.ForceStatelessL1CachingPolicy.get()));
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ void StateBaseAddressHelper<GfxFamily>::appendStateBaseAddressParameters(
|
||||
args.stateBaseAddressCmd->setStatelessDataPortAccessMemoryObjectControlState(args.gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST));
|
||||
}
|
||||
|
||||
appendExtraCacheSettings(args.stateBaseAddressCmd, args.gmmHelper->getHardwareInfo());
|
||||
appendExtraCacheSettings(args);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
@ -132,7 +132,7 @@ class HwInfoConfig {
|
||||
virtual bool isCpuCopyNecessary(const void *ptr, MemoryManager *memoryManager) const = 0;
|
||||
virtual bool isAdjustWalkOrderAvailable(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isAssignEngineRoundRobinSupported() const = 0;
|
||||
virtual uint32_t getL1CachePolicy() const = 0;
|
||||
virtual uint32_t getL1CachePolicy(bool isDebuggerActive) const = 0;
|
||||
virtual bool isEvictionIfNecessaryFlagSupported() const = 0;
|
||||
virtual void adjustNumberOfCcs(HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isPrefetcherDisablingInDirectSubmissionRequired() const = 0;
|
||||
@ -258,7 +258,7 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
bool isCpuCopyNecessary(const void *ptr, MemoryManager *memoryManager) const override;
|
||||
bool isAdjustWalkOrderAvailable(const HardwareInfo &hwInfo) const override;
|
||||
bool isAssignEngineRoundRobinSupported() const override;
|
||||
uint32_t getL1CachePolicy() const override;
|
||||
uint32_t getL1CachePolicy(bool isDebuggerActive) const override;
|
||||
bool isEvictionIfNecessaryFlagSupported() const override;
|
||||
void adjustNumberOfCcs(HardwareInfo &hwInfo) const override;
|
||||
bool isPrefetcherDisablingInDirectSubmissionRequired() const override;
|
||||
|
@ -482,8 +482,8 @@ template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::isAdjustWalkOrderAvailable(const HardwareInfo &hwInfo) const { return false; }
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
uint32_t HwInfoConfigHw<gfxProduct>::getL1CachePolicy() const {
|
||||
return L1CachePolicyHelper<gfxProduct>::getL1CachePolicy();
|
||||
uint32_t HwInfoConfigHw<gfxProduct>::getL1CachePolicy(bool isDebuggerActive) const {
|
||||
return L1CachePolicyHelper<gfxProduct>::getL1CachePolicy(isDebuggerActive);
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
|
@ -26,7 +26,7 @@ void EncodeDispatchKernel<Family>::adjustTimestampPacket(WALKER_TYPE &walkerCmd,
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const HardwareInfo &hwInfo) {
|
||||
inline void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const EncodeSurfaceStateArgs &args) {
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@ -11,7 +11,7 @@
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
void StateBaseAddressHelper<XeHpFamily>::appendExtraCacheSettings(STATE_BASE_ADDRESS *stateBaseAddress, const HardwareInfo *hwInfo) {
|
||||
void StateBaseAddressHelper<XeHpFamily>::appendExtraCacheSettings(StateBaseAddressHelperArgs<XeHpFamily> &args) {
|
||||
}
|
||||
|
||||
template struct StateBaseAddressHelper<XeHpFamily>;
|
||||
|
@ -18,9 +18,12 @@ namespace NEO {
|
||||
#ifdef SUPPORT_DG2
|
||||
|
||||
template <>
|
||||
uint32_t L1CachePolicyHelper<IGFX_DG2>::getDefaultL1CachePolicy() {
|
||||
uint32_t L1CachePolicyHelper<IGFX_DG2>::getDefaultL1CachePolicy(bool isDebuggerActive) {
|
||||
using GfxFamily = HwMapper<IGFX_DG2>::GfxFamily;
|
||||
return GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP;
|
||||
if (isDebuggerActive) {
|
||||
return GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WBP;
|
||||
}
|
||||
return GfxFamily::STATE_BASE_ADDRESS::L1_CACHE_POLICY_WB;
|
||||
}
|
||||
|
||||
template struct L1CachePolicyHelper<IGFX_DG2>;
|
||||
|
@ -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 <>
|
||||
|
@ -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) {
|
||||
|
@ -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