Add DCFlush before resolving

Change-Id: Id5f82edc4631aa16baa55b26b8bde69f4a30572c
This commit is contained in:
Kamil Diedrich 2019-02-07 13:41:03 +01:00 committed by sys_ocldev
parent e17dcfbb83
commit 89410a6733
3 changed files with 27 additions and 3 deletions

View File

@ -123,6 +123,7 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
auto pPipeControlCmd = static_cast<PIPE_CONTROL *>(commandStream->getSpace(sizeof(PIPE_CONTROL)));
*pPipeControlCmd = GfxFamily::cmdInitPipeControl;
pPipeControlCmd->setDcFlushEnable(true);
pPipeControlCmd->setCommandStreamerStallEnable(true);
}

View File

@ -1110,7 +1110,7 @@ HWTEST_F(DispatchWalkerTest, WhenCallingDefaultWaMethodsThenExpectNothing) {
EXPECT_EQ(expectedSize, actualSize);
}
HWTEST_F(DispatchWalkerTest, givenKernelWhenAuxTranslationWithoutParentKernelThenPipeControlAdded) {
HWTEST_F(DispatchWalkerTest, givenKernelWhenAuxTranslationRequiredThenPipeControlWithStallAndDCFlushAdded) {
MockKernel kernel(program.get(), kernelInfo, *pDevice);
kernelInfo.workloadInfo.workDimOffset = 0;
ASSERT_EQ(CL_SUCCESS, kernel.initialize());
@ -1141,8 +1141,17 @@ HWTEST_F(DispatchWalkerTest, givenKernelWhenAuxTranslationWithoutParentKernelThe
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(cmdList, buffer, sizeUsed));
auto itorCmd = find<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
ASSERT_NE(cmdList.end(), itorCmd);
auto pipeControls = findAll<typename FamilyType::PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
ASSERT_EQ(2u, pipeControls.size());
auto beginPipeControl = genCmdCast<typename FamilyType::PIPE_CONTROL *>(*(pipeControls[0]));
EXPECT_TRUE(beginPipeControl->getDcFlushEnable());
EXPECT_TRUE(beginPipeControl->getCommandStreamerStallEnable());
auto endPipeControl = genCmdCast<typename FamilyType::PIPE_CONTROL *>(*(pipeControls[1]));
EXPECT_FALSE(endPipeControl->getDcFlushEnable());
EXPECT_TRUE(endPipeControl->getCommandStreamerStallEnable());
}
struct ProfilingCommandsTest : public DispatchWalkerTest, ::testing::WithParamInterface<bool> {

View File

@ -7,6 +7,7 @@
#pragma once
#include "runtime/gen_common/hw_cmds.h"
#include <vector>
#include <list>
typedef std::list<void *> GenCmdList;
@ -25,6 +26,19 @@ static inline GenCmdList::iterator find(GenCmdList::iterator itorStart, GenCmdLi
return itor;
}
template <typename CommandToFind>
static inline std::vector<GenCmdList::iterator> findAll(GenCmdList::iterator commandListStart, GenCmdList::const_iterator commandListEnd) {
std::vector<GenCmdList::iterator> matchedCommands;
GenCmdList::iterator currentCommand = commandListStart;
while (currentCommand != commandListEnd) {
if (genCmdCast<CommandToFind>(*currentCommand)) {
matchedCommands.push_back(currentCommand);
}
++currentCommand;
}
return matchedCommands;
}
template <typename FamilyType>
static inline GenCmdList::iterator findMmio(GenCmdList::iterator itorStart, GenCmdList::const_iterator itorEnd, uint32_t regOffset) {
GenCmdList::iterator itor = itorStart;