mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-10 07:08:04 +08:00
Add debug flag to disable cache flush
Related-To: NEO-5144 Change-Id: I29590d840a641dfcf3fc4d099ca84f196c8fdc1f Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
78feb47d6c
commit
5af3a46662
@@ -11,6 +11,8 @@
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "opencl/source/kernel/kernel.h"
|
||||
|
||||
#include "pipe_control_args.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template <typename GfxFamily>
|
||||
@@ -153,12 +155,8 @@ void HardwareCommandsHelper<GfxFamily>::setInterfaceDescriptorOffset(
|
||||
|
||||
template <typename GfxFamily>
|
||||
void HardwareCommandsHelper<GfxFamily>::programCacheFlushAfterWalkerCommand(LinearStream *commandStream, const CommandQueue &commandQueue, const Kernel *kernel, uint64_t postSyncAddress) {
|
||||
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
|
||||
auto pipeControl = commandStream->getSpaceForCmd<PIPE_CONTROL>();
|
||||
PIPE_CONTROL cmd = GfxFamily::cmdInitPipeControl;
|
||||
cmd.setCommandStreamerStallEnable(true);
|
||||
cmd.setDcFlushEnable(true);
|
||||
*pipeControl = cmd;
|
||||
PipeControlArgs args(true);
|
||||
MemorySynchronizationCommands<GfxFamily>::addPipeControl(*commandStream, args);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -894,6 +894,46 @@ HWTEST_F(UltCommandStreamReceiverTest, addPipeControlWithFlushAllCaches) {
|
||||
EXPECT_TRUE(pipeControl->getStateCacheInvalidationEnable());
|
||||
}
|
||||
|
||||
HWTEST_F(UltCommandStreamReceiverTest, givenDebugDisablingCacheFlushWhenAddingPipeControlWithCacheFlushThenOverrideRequestAndDisableCacheFlushFlags) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.DoNotFlushCaches.set(true);
|
||||
|
||||
char buff[sizeof(PIPE_CONTROL) * 3];
|
||||
LinearStream stream(buff, sizeof(PIPE_CONTROL) * 3);
|
||||
|
||||
PipeControlArgs args(true);
|
||||
args.constantCacheInvalidationEnable = true;
|
||||
args.instructionCacheInvalidateEnable = true;
|
||||
args.pipeControlFlushEnable = true;
|
||||
args.renderTargetCacheFlushEnable = true;
|
||||
args.stateCacheInvalidationEnable = true;
|
||||
args.textureCacheInvalidationEnable = true;
|
||||
args.vfCacheInvalidationEnable = true;
|
||||
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControl(stream, args);
|
||||
|
||||
parseCommands<FamilyType>(stream, 0);
|
||||
|
||||
PIPE_CONTROL *pipeControl = getCommand<PIPE_CONTROL>();
|
||||
|
||||
ASSERT_NE(nullptr, pipeControl);
|
||||
|
||||
// WA pipeControl added
|
||||
if (cmdList.size() == 2) {
|
||||
pipeControl++;
|
||||
}
|
||||
|
||||
EXPECT_FALSE(pipeControl->getDcFlushEnable());
|
||||
EXPECT_FALSE(pipeControl->getRenderTargetCacheFlushEnable());
|
||||
EXPECT_FALSE(pipeControl->getInstructionCacheInvalidateEnable());
|
||||
EXPECT_FALSE(pipeControl->getTextureCacheInvalidationEnable());
|
||||
EXPECT_FALSE(pipeControl->getPipeControlFlushEnable());
|
||||
EXPECT_FALSE(pipeControl->getVfCacheInvalidationEnable());
|
||||
EXPECT_FALSE(pipeControl->getConstantCacheInvalidationEnable());
|
||||
EXPECT_FALSE(pipeControl->getStateCacheInvalidationEnable());
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenEnabledPreemptionWhenFlushTaskCalledThenDontProgramMediaVfeStateAgain) {
|
||||
pDevice->setPreemptionMode(PreemptionMode::ThreadGroup);
|
||||
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
@@ -72,3 +72,56 @@ GEN12LPTEST_F(UltCommandStreamReceiverTest, givenStateBaseAddressWhenItIsRequire
|
||||
EXPECT_TRUE(pipeControlCmd->getDcFlushEnable());
|
||||
EXPECT_TRUE(pipeControlCmd->getHdcPipelineFlush());
|
||||
}
|
||||
|
||||
using UltCommandStreamReceiverTestGen12Lp = UltCommandStreamReceiverTest;
|
||||
|
||||
GEN12LPTEST_F(UltCommandStreamReceiverTestGen12Lp, givenDebugEnablingCacheFlushWhenAddingPipeControlWithoutCacheFlushThenOverrideRequestAndEnableCacheFlushFlags) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.FlushAllCaches.set(true);
|
||||
|
||||
char buff[sizeof(PIPE_CONTROL) * 3];
|
||||
LinearStream stream(buff, sizeof(PIPE_CONTROL) * 3);
|
||||
|
||||
PipeControlArgs args;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControl(stream, args);
|
||||
|
||||
parseCommands<FamilyType>(stream, 0);
|
||||
|
||||
PIPE_CONTROL *pipeControl = getCommand<PIPE_CONTROL>();
|
||||
|
||||
ASSERT_NE(nullptr, pipeControl);
|
||||
|
||||
// WA pipeControl added
|
||||
if (cmdList.size() == 2) {
|
||||
pipeControl++;
|
||||
}
|
||||
|
||||
EXPECT_TRUE(pipeControl->getHdcPipelineFlush());
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(UltCommandStreamReceiverTestGen12Lp, givenDebugDisablingCacheFlushWhenAddingPipeControlWithCacheFlushThenOverrideRequestAndDisableCacheFlushFlags) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.DoNotFlushCaches.set(true);
|
||||
|
||||
char buff[sizeof(PIPE_CONTROL) * 3];
|
||||
LinearStream stream(buff, sizeof(PIPE_CONTROL) * 3);
|
||||
|
||||
PipeControlArgs args(true);
|
||||
args.hdcPipelineFlush = true;
|
||||
MemorySynchronizationCommands<FamilyType>::addPipeControl(stream, args);
|
||||
|
||||
parseCommands<FamilyType>(stream, 0);
|
||||
|
||||
PIPE_CONTROL *pipeControl = getCommand<PIPE_CONTROL>();
|
||||
|
||||
ASSERT_NE(nullptr, pipeControl);
|
||||
|
||||
// WA pipeControl added
|
||||
if (cmdList.size() == 2) {
|
||||
pipeControl++;
|
||||
}
|
||||
|
||||
EXPECT_FALSE(pipeControl->getHdcPipelineFlush());
|
||||
}
|
||||
|
||||
@@ -338,12 +338,12 @@ GEN12LPTEST_F(LriHelperTestsGen12Lp, whenProgrammingLriCommandThenExpectMmioRema
|
||||
using MemorySynchronizatiopCommandsTests = ::testing::Test;
|
||||
|
||||
GEN12LPTEST_F(MemorySynchronizatiopCommandsTests, whenSettingCacheFlushExtraFieldsThenExpectHdcFlushSet) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
PIPE_CONTROL pipeControl = FamilyType::cmdInitPipeControl;
|
||||
pipeControl.setConstantCacheInvalidationEnable(true);
|
||||
MemorySynchronizationCommands<FamilyType>::setCacheFlushExtraProperties(pipeControl);
|
||||
EXPECT_TRUE(pipeControl.getHdcPipelineFlush());
|
||||
EXPECT_FALSE(pipeControl.getConstantCacheInvalidationEnable());
|
||||
PipeControlArgs args;
|
||||
args.constantCacheInvalidationEnable = true;
|
||||
|
||||
MemorySynchronizationCommands<FamilyType>::setCacheFlushExtraProperties(args);
|
||||
EXPECT_TRUE(args.hdcPipelineFlush);
|
||||
EXPECT_FALSE(args.constantCacheInvalidationEnable);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(HwHelperTestGen12Lp, givenUnknownProductFamilyWhenGettingIsWorkaroundRequiredThenFalseIsReturned) {
|
||||
|
||||
@@ -196,4 +196,5 @@ PerformImplicitFlushForNewResource = -1
|
||||
PerformImplicitFlushForIdleGpu = -1
|
||||
ProvideVerboseImplicitFlush = false
|
||||
PauseOnGpuMode = -1
|
||||
PrintTagAllocationAddress = 0
|
||||
PrintTagAllocationAddress = 0
|
||||
DoNotFlushCaches = false
|
||||
Reference in New Issue
Block a user