summaryrefslogtreecommitdiff
path: root/utests/utest_generator.py
diff options
context:
space:
mode:
authorYang Rong <rong.r.yang@intel.com>2015-07-29 14:02:47 +0800
committerYang Rong <rong.r.yang@intel.com>2015-08-05 12:17:26 +0800
commitcdbbbaad5415e25b258f67bd19c07543a0836c3b (patch)
tree7452760ad0d063a14ef3ee7abdca9acdab4c0514 /utests/utest_generator.py
parent7e0e236f779d720bcee20bab1c7239dd0dae1fcc (diff)
downloadbeignet-cdbbbaad5415e25b258f67bd19c07543a0836c3b.tar.gz
Utest: fix a builtin_powr_float fail when OCL_STRICT_CONFORMANCE=0.
Need ingore isnan and isinf when OCL_STRICT_CONFORMANCE=0. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
Diffstat (limited to 'utests/utest_generator.py')
-rw-r--r--utests/utest_generator.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/utests/utest_generator.py b/utests/utest_generator.py
index c2205750..91cc938f 100644
--- a/utests/utest_generator.py
+++ b/utests/utest_generator.py
@@ -110,7 +110,8 @@ def udebug(ulpSize,returnType,function):
float ULPSIZE_NO_FAST_MATH = %s;
ULPSIZE_FACTOR = select_ulpsize(ULPSIZE_FAST_MATH,ULPSIZE_NO_FAST_MATH);
-
+ bool fast_math = ULPSIZE_FACTOR == ULPSIZE_FAST_MATH;
+
if (isinf(cpu_data[index])){
INFORNAN="INF";
}
@@ -137,25 +138,25 @@ def udebug(ulpSize,returnType,function):
}
else if ((ULPSIZE >= 0 && diff <= ULPSIZE) || (ULPSIZE < 0 && diff == 0)){
printf("%s expect:%s\\n", log, ULPSIZE);
- }
+ }
else
printf_c("%s expect:%s\\n", log, ULPSIZE);
#else
if (isinf(cpu_data[index])){
sprintf(log, "%s expect:%s\\n", log, INFORNAN);
- OCL_ASSERTM(isinf(gpu_data[index]),log);
- }
+ OCL_ASSERTM(isinf(gpu_data[index]) || fast_math,log);
+ }
else if (isnan(cpu_data[index])){
sprintf(log, "%s expect:%s\\n", log, INFORNAN);
- OCL_ASSERTM(isnan(gpu_data[index]),log);
- }
+ OCL_ASSERTM(isnan(gpu_data[index]) || fast_math,log);
+ }
else{
sprintf(log, "%s expect:%s\\n", log, ULPSIZE);
if (ULPSIZE < 0)
OCL_ASSERTM(gpu_data[index] == cpu_data[index], log);
else
OCL_ASSERTM(fabs(gpu_data[index]-cpu_data[index]) <= ULPSIZE, log);
- }
+ }
#endif
}
}\n'''%(returnType,Min_ulp(function),\