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

Yi Sun yi.sun at intel.com
Sun Jun 22 17:56:33 PDT 2014


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;
+
 #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



More information about the Beignet mailing list