Skip to content

Commit 271e588

Browse files
Fix filling buffers in AUBHelloWorldIntegrateTest
- whole buffers should be written with data prior usage Change-Id: I7399a77e3c62e0eb971733537fd276a46925bd25
1 parent f3a7320 commit 271e588

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

unit_tests/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,25 @@ struct AUBHelloWorldIntegrateTest : public HelloWorldFixture<AUBHelloWorldFixtur
120120
void SetUp() override {
121121
std::tie(KernelFixture::simd, param) = GetParam();
122122
ParentClass::SetUp();
123-
auto &commandStreamReceiver = pDevice->getCommandStreamReceiver();
124-
commandStreamReceiver.createAllocationAndHandleResidency(pDestMemory, sizeUserMemory);
125-
commandStreamReceiver.createAllocationAndHandleResidency(pSrcMemory, sizeUserMemory);
126123
}
127124

128125
void TearDown() override {
129126
ParentClass::TearDown();
130127
}
128+
129+
template <typename FamilyType>
130+
void writeMemory(GraphicsAllocation *allocation) {
131+
AUBCommandStreamReceiverHw<FamilyType> *aubCsr = nullptr;
132+
if (testMode == TestMode::AubTests) {
133+
aubCsr = reinterpret_cast<AUBCommandStreamReceiverHw<FamilyType> *>(pCommandStreamReceiver);
134+
} else if (testMode == TestMode::AubTestsWithTbx) {
135+
auto tbxWithAubCsr = reinterpret_cast<CommandStreamReceiverWithAUBDump<TbxCommandStreamReceiverHw<FamilyType>> *>(pCommandStreamReceiver);
136+
aubCsr = reinterpret_cast<AUBCommandStreamReceiverHw<FamilyType> *>(tbxWithAubCsr->aubCSR);
137+
tbxWithAubCsr->writeMemory(*allocation);
138+
}
139+
140+
aubCsr->writeMemory(*allocation);
141+
}
131142
TestParam param;
132143
};
133144

@@ -140,6 +151,9 @@ HWTEST_P(AUBHelloWorldIntegrateTest, simple) {
140151
cl_event *eventWaitList = nullptr;
141152
cl_event *event = nullptr;
142153

154+
writeMemory<FamilyType>(destBuffer->getGraphicsAllocation());
155+
writeMemory<FamilyType>(srcBuffer->getGraphicsAllocation());
156+
143157
auto retVal = this->pCmdQ->enqueueKernel(
144158
this->pKernel,
145159
workDim,

0 commit comments

Comments
 (0)