Skip to content

Commit 9c181df

Browse files
Don't use half_float images with bcs OCL
Signed-off-by: Kamil Kopryk <[email protected]> Related-To: NEO-4692
1 parent edf294b commit 9c181df

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

opencl/source/command_queue/command_queue.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,7 @@ bool CommandQueue::blitEnqueueImageAllowed(const size_t *origin, const size_t *r
757757
blitEnqueuImageAllowed &= (origin[0] + region[0] <= BlitterConstants::maxBlitWidth) && (origin[1] + region[1] <= BlitterConstants::maxBlitHeight);
758758
blitEnqueuImageAllowed &= !isMipMapped(image.getImageDesc());
759759
blitEnqueuImageAllowed &= !IsNV12Image(&image.getImageFormat());
760+
blitEnqueuImageAllowed &= !(image.getImageFormat().image_channel_data_type == CL_HALF_FLOAT);
760761

761762
return blitEnqueuImageAllowed;
762763
}

opencl/test/unit_test/command_queue/command_queue_tests.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,23 @@ TEST(CommandQueue, givenNV12ImageWhenCallingBlitEnqueueImageAllowedThenCorrectRe
13701370
EXPECT_TRUE(queue.blitEnqueueImageAllowed(correctOrigin, correctRegion, image));
13711371
}
13721372

1373+
TEST(CommandQueue, givenHalfFloatImageWhenCallingBlitEnqueueImageAllowedThenCorrectResultIsReturned) {
1374+
DebugManagerStateRestore restorer;
1375+
DebugManager.flags.EnableBlitterForReadWriteImage.set(1);
1376+
MockContext context{};
1377+
MockCommandQueue queue(&context, context.getDevice(0), 0);
1378+
1379+
size_t correctRegion[3] = {10u, 10u, 0};
1380+
size_t correctOrigin[3] = {1u, 1u, 0};
1381+
MockImageBase image;
1382+
1383+
image.imageFormat.image_channel_data_type = CL_HALF_FLOAT;
1384+
EXPECT_FALSE(queue.blitEnqueueImageAllowed(correctOrigin, correctRegion, image));
1385+
1386+
image.imageFormat.image_channel_data_type = CL_UNORM_INT8;
1387+
EXPECT_TRUE(queue.blitEnqueueImageAllowed(correctOrigin, correctRegion, image));
1388+
}
1389+
13731390
TEST(CommandQueue, givenSupportForOperationWhenValidatingSupportThenReturnSuccess) {
13741391
MockCommandQueue queue{};
13751392

0 commit comments

Comments
 (0)