Allow CL_FLOAT denorm flushing for write tests (#28) (#456)

* Require exact for match normals, instead of arbitrary .005 relative error
* Add relaxation to allow 0 when float denormal is expected
* Refactor to use common validation function
This commit is contained in:
Jim Lewis
2019-11-15 07:38:15 -06:00
committed by Kévin Petit
parent 88004077e3
commit 040321d8b9
7 changed files with 50 additions and 69 deletions

View File

@@ -1808,7 +1808,7 @@ static inline void check_for_denorms(float a[4], int *containsDenorms )
{
for( int i = 0; i < 4; i++ )
{
if( fabsf(a[i]) < FLT_MIN )
if( IsFloatSubnormal( a[i] ) )
a[i] = copysignf( 0.0f, a[i] );
}
}
@@ -1816,7 +1816,7 @@ static inline void check_for_denorms(float a[4], int *containsDenorms )
{
for( int i = 0; i < 4; i++ )
{
if( fabs(a[i]) < FLT_MIN )
if( IsFloatSubnormal( a[i] ) )
{
*containsDenorms = 1;
break;