[beignet] 02/07: Fix bug in compiler_fill_image_1d_array test setup

Rebecca Palmer rnpalmer-guest at moszumanska.debian.org
Fri Feb 6 20:13:58 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 b36b0c838806fd9f80f08a6d9403d906d5664e98
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date:   Fri Feb 6 13:23:38 2015 +0000

    Fix bug in compiler_fill_image_1d_array test setup
---
 debian/changelog                                   |  1 +
 .../patches/fix-compiler_fill_image_1d_array.patch | 51 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 53 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 170bfb8..bec8d4e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ beignet (1.0.1-1) UNRELEASED; urgency=medium
     (Closes: #768185)
   * Rename to beignet-opencl-icd for consistency.
   * Add more debug output to builtin_pow test.
+  * Fix bug in compiler_fill_image_1d_array test setup.
 
  -- Andreas Beckmann <anbe at debian.org>  Fri, 23 Jan 2015 23:17:24 +0100
 
diff --git a/debian/patches/fix-compiler_fill_image_1d_array.patch b/debian/patches/fix-compiler_fill_image_1d_array.patch
new file mode 100644
index 0000000..04abf2b
--- /dev/null
+++ b/debian/patches/fix-compiler_fill_image_1d_array.patch
@@ -0,0 +1,51 @@
+Description: Fix bug in compiler_fill_image_1d_array test setup
+
+This test used memset() to clear a 64x1x8 CLimage array, without taking
+into account that the hardware pads this to 64x2x8.
+Use clEnqueueWriteImage instead.
+
+Origin: upstream
+Author: Junyan He
+
+ utests/compiler_fill_image_1d_array.cpp | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/utests/compiler_fill_image_1d_array.cpp b/utests/compiler_fill_image_1d_array.cpp
+index cc7cf0a..67f9643 100644
+--- a/utests/compiler_fill_image_1d_array.cpp
++++ b/utests/compiler_fill_image_1d_array.cpp
+@@ -10,6 +10,11 @@ static void compiler_fill_image_1d_array(void)
+   size_t origin[3] = { };
+   size_t region[3];
+   uint32_t* dst;
++  uint32_t* src;
++
++  region[0] = w;
++  region[1] = array;
++  region[2] = 1;
+ 
+   memset(&desc, 0x0, sizeof(cl_image_desc));
+   memset(&format, 0x0, sizeof(cl_image_format));
+@@ -26,9 +31,9 @@ static void compiler_fill_image_1d_array(void)
+ 
+   OCL_CREATE_IMAGE(buf[0], 0, &format, &desc, NULL);
+ 
+-  OCL_MAP_BUFFER_GTT(0);
+-  memset(buf_data[0], 0, sizeof(uint32_t) * w * array);
+-  OCL_UNMAP_BUFFER_GTT(0);
++  src = (uint32_t*)malloc(w*array*sizeof(uint32_t));
++  memset(src, 0, sizeof(uint32_t) * w * array);
++  OCL_WRITE_IMAGE(buf[0], origin, region, src);
+ 
+   // Run the kernel
+   OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]);
+@@ -39,9 +44,6 @@ static void compiler_fill_image_1d_array(void)
+   OCL_NDRANGE(2);
+ 
+   // Check result
+-  region[0] = w;
+-  region[1] = array;
+-  region[2] = 1;
+   dst = (uint32_t*)malloc(w*array*sizeof(uint32_t));
+   OCL_READ_IMAGE(buf[0], origin, region, dst);
+ 
diff --git a/debian/patches/series b/debian/patches/series
index b6a698d..90062fe 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ Debian-compliant-compiler-flags-handling.patch
 Utest-requires-deprecated-function-names.patch
 Link-against-terminfo.patch
 Enable-test-debug.patch
+fix-compiler_fill_image_1d_array.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