mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Dispatch blit operation in blocked path
Change-Id: I2230bde051449bf22c74c112bbe5719aad644533 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com> Related-To: NEO-3020
This commit is contained in:
committed by
sys_ocldev
parent
bf3210c1cd
commit
f4008336f8
@@ -702,7 +702,7 @@ struct BcsBufferTests : public ::testing::Test {
|
||||
}
|
||||
|
||||
bcsMockContext = std::make_unique<BcsMockContext>(device.get());
|
||||
commandQueue.reset(CommandQueue::create(bcsMockContext.get(), device.get(), nullptr, retVal));
|
||||
commandQueue.reset(new MockCommandQueueHw<FamilyType>(bcsMockContext.get(), device.get(), nullptr));
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
@@ -767,7 +767,7 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsSupportedWhenEnqueueReadWriteBufferIs
|
||||
EXPECT_EQ(2u, bcsCsr->blitBufferCalled);
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsSupportedWhenQueueIsBlockedThenDontTakeBcsPath) {
|
||||
HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsSupportedWhenQueueIsBlockedThenDispatchBlitWhenUnblocked) {
|
||||
auto bcsCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(commandQueue->getBcsCommandStreamReceiver());
|
||||
|
||||
auto bufferForBlt = clUniquePtr(Buffer::create(bcsMockContext.get(), CL_MEM_READ_WRITE, 1, nullptr, retVal));
|
||||
@@ -781,10 +781,49 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsSupportedWhenQueueIsBlockedThenDontTa
|
||||
|
||||
userEvent.setStatus(CL_COMPLETE);
|
||||
|
||||
commandQueue->enqueueWriteBuffer(bufferForBlt.get(), CL_FALSE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(1u, bcsCsr->blitBufferCalled);
|
||||
commandQueue->enqueueReadBuffer(bufferForBlt.get(), CL_FALSE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(2u, bcsCsr->blitBufferCalled);
|
||||
|
||||
commandQueue->enqueueWriteBuffer(bufferForBlt.get(), CL_FALSE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(3u, bcsCsr->blitBufferCalled);
|
||||
commandQueue->enqueueReadBuffer(bufferForBlt.get(), CL_FALSE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(4u, bcsCsr->blitBufferCalled);
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(BcsBufferTests, givenBlockedBlitEnqueueWhenUnblockingThenMakeResidentAllTimestampPackets) {
|
||||
auto bcsCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(commandQueue->getBcsCommandStreamReceiver());
|
||||
bcsCsr->storeMakeResidentAllocations = true;
|
||||
|
||||
auto mockCmdQ = static_cast<MockCommandQueueHw<FamilyType> *>(commandQueue.get());
|
||||
|
||||
auto bufferForBlt = clUniquePtr(Buffer::create(bcsMockContext.get(), CL_MEM_READ_WRITE, 1, nullptr, retVal));
|
||||
bufferForBlt->forceDisallowCPUCopy = true;
|
||||
|
||||
TimestampPacketContainer previousTimestampPackets;
|
||||
mockCmdQ->obtainNewTimestampPacketNodes(1, previousTimestampPackets, false);
|
||||
auto dependencyFromPreviousEnqueue = mockCmdQ->timestampPacketContainer->peekNodes()[0];
|
||||
|
||||
auto event = make_releaseable<Event>(mockCmdQ, CL_COMMAND_READ_BUFFER, 0, 0);
|
||||
MockTimestampPacketContainer eventDependencyContainer(*bcsCsr->getTimestampPacketAllocator(), 1);
|
||||
auto eventDependency = eventDependencyContainer.getNode(0);
|
||||
event->addTimestampPacketNodes(eventDependencyContainer);
|
||||
|
||||
auto userEvent = make_releaseable<UserEvent>(bcsMockContext.get());
|
||||
cl_event waitlist[] = {userEvent.get(), event.get()};
|
||||
|
||||
commandQueue->enqueueReadBuffer(bufferForBlt.get(), CL_FALSE, 0, 1, &hostPtr, nullptr, 2, waitlist, nullptr);
|
||||
|
||||
auto outputDependency = mockCmdQ->timestampPacketContainer->peekNodes()[0];
|
||||
EXPECT_NE(outputDependency, dependencyFromPreviousEnqueue);
|
||||
|
||||
EXPECT_FALSE(bcsCsr->isMadeResident(dependencyFromPreviousEnqueue->getBaseGraphicsAllocation()));
|
||||
EXPECT_FALSE(bcsCsr->isMadeResident(outputDependency->getBaseGraphicsAllocation()));
|
||||
EXPECT_FALSE(bcsCsr->isMadeResident(eventDependency->getBaseGraphicsAllocation()));
|
||||
|
||||
userEvent->setStatus(CL_COMPLETE);
|
||||
|
||||
EXPECT_TRUE(bcsCsr->isMadeResident(dependencyFromPreviousEnqueue->getBaseGraphicsAllocation(), bcsCsr->taskCount));
|
||||
EXPECT_TRUE(bcsCsr->isMadeResident(outputDependency->getBaseGraphicsAllocation(), bcsCsr->taskCount));
|
||||
EXPECT_TRUE(bcsCsr->isMadeResident(eventDependency->getBaseGraphicsAllocation(), bcsCsr->taskCount));
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(BcsBufferTests, givenWriteBufferEnqueueWhenProgrammingCommandStreamThenAddSemaphoreWait) {
|
||||
|
||||
Reference in New Issue
Block a user