[Beignet] [PATCH opencl-1.2] Fix the random failed of compiler_fill_image_1d

junyan.he at inbox.com junyan.he at inbox.com
Tue Jun 10 20:59:56 PDT 2014


From: Junyan He <junyan.he at linux.intel.com>

This case failed because we do not init the dst
buffer to all zero. It have some random value in it.

Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
 utests/compiler_fill_image_1d.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/utests/compiler_fill_image_1d.cpp b/utests/compiler_fill_image_1d.cpp
index c1011ba..e644c5f 100644
--- a/utests/compiler_fill_image_1d.cpp
+++ b/utests/compiler_fill_image_1d.cpp
@@ -21,6 +21,12 @@ static void compiler_fill_image_1d(void)
 
   OCL_CREATE_IMAGE(buf[0], 0, &format, &desc, NULL);
 
+  OCL_MAP_BUFFER_GTT(0);
+  for (uint32_t i = 0; i < w; i++) {
+      ((uint32_t*)buf_data[0])[i] = 0;
+  }
+  OCL_UNMAP_BUFFER_GTT(0);
+
   // Run the kernel
   OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]);
   globals[0] = w/2;
-- 
1.8.3.2



More information about the Beignet mailing list