[Beignet] [PATCH 2/2] utest_generator.py: add OCL_STRICT_CONFORMANCE enviroment condition.

Zhigang Gong zhigang.gong at linux.intel.com
Sun Jun 22 19:51:33 PDT 2014


On Mon, Jun 23, 2014 at 08:56:33AM +0800, Yi Sun wrote:
> For auto-generated math cases, when OCL_STRICT_CONFORMANCE is set, the expected diff increases to 0.001
> 
> Signed-off-by: Yi Sun <yi.sun at intel.com>
> 
> diff --git a/utests/utest_generator.py b/utests/utest_generator.py
> index 94900d9..37473d7 100644
> --- a/utests/utest_generator.py
> +++ b/utests/utest_generator.py
> @@ -21,6 +21,8 @@ def udebug(ulpSize,returnType):
>    text='''
>      static const char* INFORNAN;
>      static %s ULPSIZE;
> +
> +    const char* env_strict = getenv("OCL_STRICT_CONFORMANCE");
>      
>      if (isinf(cpu_data[index])){
>        INFORNAN="INF";
> @@ -32,6 +34,9 @@ def udebug(ulpSize,returnType):
>        ULPSIZE=cl_%s(cpu_data[index]) * %s;
>      }
>  
> +    if ( strcmp(env_strict, "0") == 0)
> +      ULPSIZE = 0.01;
Set ULPSIZE to a fixed value is not correct. You still need to consider the target result.
If the target result is 1e20, then 0.01 will be an impossible accuracy diff even with full
double precision support.

> +
>  #if udebug 
>      if (isinf(cpu_data[index])){ 
>        if (isinf(gpu_data[index]))
> @@ -128,6 +133,7 @@ which can print more values and information to assist debuging the issue.
>  #include <stdio.h>
>  #include <math.h>
>  #include <algorithm>
> +#include <string.h>
>  
>  #define udebug 0
>  #define FLT_MAX 0x1.fffffep127f
> -- 
> 1.8.5.3
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list