mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Ignore padding bits in clCopyImage/clFillImage testing (#1184)
The CL_UNORM_SHORT_555 and CL_UNORM_INT_101010 formats contain padding bits which need to be ignored in clCopyImage and clFillImage testing. For clFillImage tests, padding was not ignored for the CL_UNORM_SHORT_555 format, and was ignored for CL_UNORM_INT_101010 by modifying actual and reference data. For clCopyImage tests, padding was not ignored, both for CL_UNORM_SHORT_555 and for CL_UNORM_INT_101010. Fix this by adding a new compare_scanlines() function, which is used for both of these formats, and does not modify the actual or reference data. Signed-off-by: Stuart Brady <stuart.brady@arm.com>
This commit is contained in:
@@ -547,18 +547,19 @@ int test_copy_image_generic( cl_context context, cl_command_queue queue, image_d
|
||||
{
|
||||
if( memcmp( sourcePtr, destPtr, scanlineSize ) != 0 )
|
||||
{
|
||||
// Find the first missing pixel
|
||||
// Find the first differing pixel
|
||||
size_t pixel_size = get_pixel_size( dstImageInfo->format );
|
||||
size_t where = 0;
|
||||
for( where = 0; where < dstImageInfo->width; where++ )
|
||||
if( memcmp( sourcePtr + pixel_size * where, destPtr + pixel_size * where, pixel_size) )
|
||||
break;
|
||||
size_t where =
|
||||
compare_scanlines(dstImageInfo, sourcePtr, destPtr);
|
||||
|
||||
print_first_pixel_difference_error(
|
||||
where, sourcePtr + pixel_size * where,
|
||||
destPtr + pixel_size * where, dstImageInfo, y,
|
||||
dstImageInfo->depth);
|
||||
return -1;
|
||||
if (where < dstImageInfo->width)
|
||||
{
|
||||
print_first_pixel_difference_error(
|
||||
where, sourcePtr + pixel_size * where,
|
||||
destPtr + pixel_size * where, dstImageInfo, y,
|
||||
dstImageInfo->depth);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
sourcePtr += rowPitch;
|
||||
if((dstImageInfo->type == CL_MEM_OBJECT_IMAGE1D_ARRAY || dstImageInfo->type == CL_MEM_OBJECT_IMAGE1D))
|
||||
|
||||
@@ -468,27 +468,19 @@ int test_fill_image_generic( cl_context context, cl_command_queue queue, image_d
|
||||
{
|
||||
for ( size_t y = 0; y < secondDim; y++ )
|
||||
{
|
||||
// If the data type is 101010 ignore bits 31 and 32 when comparing the row
|
||||
if (imageInfo->format->image_channel_data_type == CL_UNORM_INT_101010) {
|
||||
for (size_t w=0;w!=scanlineSize/4;++w) {
|
||||
((cl_uint*)sourcePtr)[w] &= 0x3FFFFFFF;
|
||||
((cl_uint*)destPtr)[w] &= 0x3FFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
if (memcmp( sourcePtr, destPtr, scanlineSize ) != 0)
|
||||
{
|
||||
// Find the first missing pixel
|
||||
// Find the first differing pixel
|
||||
size_t pixel_size = get_pixel_size( imageInfo->format );
|
||||
size_t where = 0;
|
||||
for ( where = 0; where < imageInfo->width; where++ )
|
||||
if ( memcmp( sourcePtr + pixel_size * where, destPtr + pixel_size * where, pixel_size) )
|
||||
break;
|
||||
size_t where = compare_scanlines(imageInfo, sourcePtr, destPtr);
|
||||
|
||||
print_first_pixel_difference_error(
|
||||
where, sourcePtr + pixel_size * where,
|
||||
destPtr + pixel_size * where, imageInfo, y, thirdDim);
|
||||
return -1;
|
||||
if (where < imageInfo->width)
|
||||
{
|
||||
print_first_pixel_difference_error(
|
||||
where, sourcePtr + pixel_size * where,
|
||||
destPtr + pixel_size * where, imageInfo, y, thirdDim);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
total_matched += scanlineSize;
|
||||
|
||||
Reference in New Issue
Block a user