Skip to content

Commit dd75cdc

Browse files
Allow for blit enqueue on read/write buffer operations
Change-Id: Id8f6feb09503a901bfbbd9bd755eb6f237fc1f23 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com> Related-To: NEO-3020
1 parent 439cbff commit dd75cdc

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

runtime/command_queue/command_queue.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,11 +578,10 @@ bool CommandQueue::queueDependenciesClearRequired() const {
578578
}
579579

580580
bool CommandQueue::blitEnqueueAllowed(cl_command_type cmdType) const {
581-
bool blitAllowed = false;
581+
bool blitAllowed = device->getExecutionEnvironment()->getHardwareInfo()->capabilityTable.blitterOperationsSupported;
582582

583583
if (DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get() != -1) {
584-
blitAllowed = !!DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get() &&
585-
device->getExecutionEnvironment()->getHardwareInfo()->capabilityTable.blitterOperationsSupported;
584+
blitAllowed &= !!DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.get();
586585
}
587586

588587
bool commandAllowed = (CL_COMMAND_READ_BUFFER == cmdType) || (CL_COMMAND_WRITE_BUFFER == cmdType);

unit_tests/mem_obj/buffer_tests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -757,14 +757,14 @@ HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsSupportedWhenEnqueueReadWriteBufferIs
757757
commandQueue->enqueueWriteBuffer(bufferForBlt.get(), CL_TRUE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
758758
commandQueue->enqueueReadBuffer(bufferForBlt.get(), CL_TRUE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
759759

760-
EXPECT_EQ(0u, bcsCsr->blitBufferCalled);
760+
EXPECT_EQ(2u, bcsCsr->blitBufferCalled);
761761

762762
DebugManager.flags.EnableBlitterOperationsForReadWriteBuffers.set(1);
763763
hwInfo->capabilityTable.blitterOperationsSupported = true;
764764
commandQueue->enqueueWriteBuffer(bufferForBlt.get(), CL_TRUE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
765-
EXPECT_EQ(1u, bcsCsr->blitBufferCalled);
765+
EXPECT_EQ(3u, bcsCsr->blitBufferCalled);
766766
commandQueue->enqueueReadBuffer(bufferForBlt.get(), CL_TRUE, 0, 1, &hostPtr, nullptr, 0, nullptr, nullptr);
767-
EXPECT_EQ(2u, bcsCsr->blitBufferCalled);
767+
EXPECT_EQ(4u, bcsCsr->blitBufferCalled);
768768
}
769769

770770
HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsSupportedWhenQueueIsBlockedThenDispatchBlitWhenUnblocked) {

0 commit comments

Comments
 (0)