mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-21 14:59:02 +00:00
* Allow CL_HALF_FLOAT denorm flushing for write tests (#452) * On mismatch, add relaxation when denormal half result is expected * Refactor to use common validation function * Clean up some diagnostics * Fix review comments - use cl_half - remove extraneous casts - replace literals with sizeof() * Document rollover trick for IsHalfSubnormal
This commit is contained in:
@@ -1155,7 +1155,7 @@ bool validate_float_write_results( float *expected, float *actual, image_descrip
|
||||
{
|
||||
bool pass = true;
|
||||
// Compare floats
|
||||
if( memcmp( expected, actual, 4 * get_format_channel_count( imageInfo->format ) ) != 0 )
|
||||
if( memcmp( expected, actual, sizeof( cl_float ) * get_format_channel_count( imageInfo->format ) ) != 0 )
|
||||
{
|
||||
// 8.3.3 Fix up cases where we have NaNs or flushed denorms; "all other values must be preserved"
|
||||
for ( size_t j = 0; j < get_format_channel_count( imageInfo->format ); j++ )
|
||||
@@ -1171,6 +1171,25 @@ bool validate_float_write_results( float *expected, float *actual, image_descrip
|
||||
return pass;
|
||||
}
|
||||
|
||||
bool validate_half_write_results( cl_half *expected, cl_half *actual, image_descriptor *imageInfo )
|
||||
{
|
||||
bool pass = true;
|
||||
// Compare half floats
|
||||
if (memcmp(expected, actual, sizeof( cl_half ) * get_format_channel_count(imageInfo->format)) != 0) {
|
||||
|
||||
// 8.3.2 Fix up cases where we have NaNs or generated half denormals
|
||||
for ( size_t j = 0; j < get_format_channel_count( imageInfo->format ); j++ ) {
|
||||
if ( is_half_nan( expected[j] ) && is_half_nan( actual[j] ) )
|
||||
continue;
|
||||
if ( is_half_denorm( expected[j] ) && is_half_zero( actual[j] ) )
|
||||
continue;
|
||||
pass = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return pass;
|
||||
}
|
||||
|
||||
int test_read_image_2D( cl_context context, cl_command_queue queue, cl_kernel kernel,
|
||||
image_descriptor *imageInfo, image_sampler_data *imageSampler,
|
||||
bool useFloatCoords, ExplicitType outputType, MTdata d )
|
||||
|
||||
Reference in New Issue
Block a user