Allow for blit enqueue on read/write buffer operations

Change-Id: Iacdd2b75c671209d961fdf1754ff348af45ae56c
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
Related-To: NEO-3020
This commit is contained in:
Dunajski, Bartosz
2019-09-09 08:45:37 +02:00
committed by sys_ocldev
parent 4c1adc4d47
commit 70de319f33
2 changed files with 5 additions and 6 deletions

View File

@@ -578,11 +578,10 @@ bool CommandQueue::queueDependenciesClearRequired() const {
}
bool CommandQueue::blitEnqueueAllowed(cl_command_type cmdType) const {
bool blitAllowed = false;
bool blitAllowed = device->getExecutionEnvironment()->getHardwareInfo()->capabilityTable.blitterOperationsSupported;
if (DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get() != -1) {
blitAllowed = !!DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get() &&
device->getExecutionEnvironment()->getHardwareInfo()->capabilityTable.blitterOperationsSupported;
blitAllowed &= !!DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get();
}
bool commandAllowed = (CL_COMMAND_READ_BUFFER == cmdType) || (CL_COMMAND_WRITE_BUFFER == cmdType);

View File

@@ -757,14 +757,14 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsSupportedWhenEnqueueReadWriteBufferIs
commandQueue->enqueueWriteBuffer(bufferForBlt.get(), CL_TRUE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
commandQueue->enqueueReadBuffer(bufferForBlt.get(), CL_TRUE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
EXPECT_EQ(0u, bcsCsr->blitBufferCalled);
EXPECT_EQ(2u, bcsCsr->blitBufferCalled);
DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.set(1);
hwInfo->capabilityTable.blitterOperationsSupported = true;
commandQueue->enqueueWriteBuffer(bufferForBlt.get(), CL_TRUE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
EXPECT_EQ(1u, bcsCsr->blitBufferCalled);
EXPECT_EQ(3u, bcsCsr->blitBufferCalled);
commandQueue->enqueueReadBuffer(bufferForBlt.get(), CL_TRUE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
EXPECT_EQ(2u, bcsCsr->blitBufferCalled);
EXPECT_EQ(4u, bcsCsr->blitBufferCalled);
}
HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsSupportedWhenQueueIsBlockedThenDispatchBlitWhenUnblocked) {