[beignet] 05/07: Fix spurious builtin_pow test failure

Rebecca Palmer rnpalmer-guest at moszumanska.debian.org
Fri Apr 24 21:56:27 UTC 2015


This is an automated email from the git hooks/post-receive script.

rnpalmer-guest pushed a commit to branch master
in repository beignet.

commit d6ede164821fcca4ce68ceae3cbcfcd385c9f9e2
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date:   Fri Apr 24 21:29:13 2015 +0100

    Fix spurious builtin_pow test failure
---
 debian/changelog                                   |  1 +
 .../patches/builtin_pow-fix-spurious-failure.patch | 38 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 40 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 923a56a..4967630 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ beignet (1.0.3-1) UNRELEASED; urgency=medium
 
   * New upstream release.
   * Drop patches applied upstream, refresh others.
+  * Fix bug in builtin_pow test.
 
  -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Fri, 24 Apr 2015 21:16:12 +0100
 
diff --git a/debian/patches/builtin_pow-fix-spurious-failure.patch b/debian/patches/builtin_pow-fix-spurious-failure.patch
new file mode 100644
index 0000000..cbec5da
--- /dev/null
+++ b/debian/patches/builtin_pow-fix-spurious-failure.patch
@@ -0,0 +1,38 @@
+Description: Declared lack of denormals is not a bug
+
+...so don't fail the test when the denormal 0.01**20.5 is flushed to 0
+
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+Forwarded: http://lists.freedesktop.org/archives/beignet/2015-April/005549.html
+
+--- beignet-1.0.2.orig/utests/builtin_pow.cpp
++++ beignet-1.0.2/utests/builtin_pow.cpp
+@@ -38,6 +38,9 @@ static void builtin_pow(void)
+       input_data2[i*count_input_ori+k] = ori_data[k];
+     }
+ 
++  cl_device_fp_config fp_config;
++  clGetDeviceInfo(device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof(cl_device_fp_config), &fp_config, 0);
++  bool denormals_supported = fp_config & CL_FP_DENORM;
+   const char* env_strict = getenv("OCL_STRICT_CONFORMANCE");
+   float ULPSIZE_FACTOR = 16.0;
+   if (env_strict != NULL && strcmp(env_strict, "0") == 0)
+@@ -76,7 +79,7 @@ static void builtin_pow(void)
+ #if udebug
+       if ( (isinf(cpu_data[index_cur]) && !isinf(gpu_data[index_cur])) ||
+            (isnan(cpu_data[index_cur]) && !isnan(gpu_data[index_cur])) ||
+-           (fabs(gpu_data[index_cur] - cpu_data[index_cur]) > cl_FLT_ULP(cpu_data[index_cur]) * ULPSIZE_FACTOR)   )
++           (fabs(gpu_data[index_cur] - cpu_data[index_cur]) > cl_FLT_ULP(cpu_data[index_cur]) * ULPSIZE_FACTOR && (denormals_supported || gpu_data[index_cur]!=0 || std::fpclassify(cpu_data[index_cur])!=FP_SUBNORMAL) ) )
+       {
+         printf_c("%d/%d: x:%f, y:%f -> gpu:%e  cpu:%e err: %e ULP: %e\n", k, i, input_data1[k], input_data2[k], gpu_data[index_cur], cpu_data[index_cur],gpu_data[index_cur]-cpu_data[index_cur],cl_FLT_ULP(cpu_data[index_cur]));
+       }
+@@ -89,7 +92,8 @@ static void builtin_pow(void)
+        OCL_ASSERT(isnan(gpu_data[index_cur]));
+      else
+      {
+-       OCL_ASSERT(fabs(gpu_data[index_cur] - cpu_data[index_cur]) < cl_FLT_ULP(cpu_data[index_cur]) * ULPSIZE_FACTOR);
++       OCL_ASSERT((fabs(gpu_data[index_cur] - cpu_data[index_cur]) < cl_FLT_ULP(cpu_data[index_cur]) * ULPSIZE_FACTOR) ||
++       (!denormals_supported && gpu_data[index_cur]==0 && std::fpclassify(cpu_data[index_cur])==FP_SUBNORMAL) );
+      }
+ #endif
+     }
diff --git a/debian/patches/series b/debian/patches/series
index b75771f..d7373e1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ support-kfreebsd.patch
 reduce-notfound-output.patch
 default-to-full-precision.patch
 shared-llvm.patch
+builtin_pow-fix-spurious-failure.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git



More information about the Pkg-opencl-commits mailing list