Fix filling buffers in AUBHelloWorldIntegrateTest

- whole buffers should be written with data prior usage

Change-Id: I7399a77e3c62e0eb971733537fd276a46925bd25
This commit is contained in:
Hoppe, Mateusz
2018-10-17 13:47:11 +02:00
committed by sys_ocldev
parent f3a732081e
commit 271e588c6e

View File

@@ -120,14 +120,25 @@ struct AUBHelloWorldIntegrateTest : public HelloWorldFixture<AUBHelloWorldFixtur
void SetUp() override {
std::tie(KernelFixture::simd, param) = GetParam();
ParentClass::SetUp();
auto &commandStreamReceiver = pDevice->getCommandStreamReceiver();
commandStreamReceiver.createAllocationAndHandleResidency(pDestMemory, sizeUserMemory);
commandStreamReceiver.createAllocationAndHandleResidency(pSrcMemory, sizeUserMemory);
}
void TearDown() override {
ParentClass::TearDown();
}
template <typename FamilyType>
void writeMemory(GraphicsAllocation *allocation) {
AUBCommandStreamReceiverHw<FamilyType> *aubCsr = nullptr;
if (testMode == TestMode::AubTests) {
aubCsr = reinterpret_cast<AUBCommandStreamReceiverHw<FamilyType> *>(pCommandStreamReceiver);
} else if (testMode == TestMode::AubTestsWithTbx) {
auto tbxWithAubCsr = reinterpret_cast<CommandStreamReceiverWithAUBDump<TbxCommandStreamReceiverHw<FamilyType>> *>(pCommandStreamReceiver);
aubCsr = reinterpret_cast<AUBCommandStreamReceiverHw<FamilyType> *>(tbxWithAubCsr->aubCSR);
tbxWithAubCsr->writeMemory(*allocation);
}
aubCsr->writeMemory(*allocation);
}
TestParam param;
};
@@ -140,6 +151,9 @@ HWTEST_P(AUBHelloWorldIntegrateTest, simple) {
cl_event *eventWaitList = nullptr;
cl_event *event = nullptr;
writeMemory<FamilyType>(destBuffer->getGraphicsAllocation());
writeMemory<FamilyType>(srcBuffer->getGraphicsAllocation());
auto retVal = this->pCmdQ->enqueueKernel(
this->pKernel,
workDim,