[Beignet] [PATCH 5/7 V2] Utest: Fix a bug for double div.

junyan.he at inbox.com junyan.he at inbox.com
Thu Nov 5 00:15:45 PST 2015


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

Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
 utests/compiler_double_convert.cpp | 3 +--
 utests/compiler_double_div.cpp     | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/utests/compiler_double_convert.cpp b/utests/compiler_double_convert.cpp
index 9c5c97b..30787d2 100644
--- a/utests/compiler_double_convert.cpp
+++ b/utests/compiler_double_convert.cpp
@@ -613,8 +613,7 @@ void compiler_float_convert_double(void)
   OCL_MAP_BUFFER(1);
   for (int32_t i = 0; i < (int32_t) n; ++i) {
     //printf("%f,   \t%f\n", ((double*)buf_data[1])[i], cpu_dst[i]);
-    OCL_ASSERT(((double*)buf_data[2])[i] == cpu_dst0[i]);
-    OCL_ASSERT(((double*)buf_data[3])[i] == cpu_dst1[i]);
+    OCL_ASSERT(((double*)buf_data[1])[i] == cpu_dst[i]);
   }
   OCL_UNMAP_BUFFER(1);
 }
diff --git a/utests/compiler_double_div.cpp b/utests/compiler_double_div.cpp
index db763e3..11578cf 100644
--- a/utests/compiler_double_div.cpp
+++ b/utests/compiler_double_div.cpp
@@ -23,12 +23,15 @@ void compiler_double_div(void)
   // Run random tests
   OCL_MAP_BUFFER(0);
   OCL_MAP_BUFFER(1);
+  OCL_MAP_BUFFER(2);
   for (int32_t i = 0; i < (int32_t) n; ++i) {
     cpu_src0[i] = ((double*)buf_data[0])[i] = ((double)(((i - 5)*1334) * 11105));
     cpu_src1[i] = ((double*)buf_data[1])[i] = 499.13542123d*(i + 132.43d + 142.32*i);
+    ((double*)buf_data[2])[i] = 0.0d;
   }
   OCL_UNMAP_BUFFER(0);
   OCL_UNMAP_BUFFER(1);
+  OCL_UNMAP_BUFFER(2);
 
   // Run the kernel on GPU
   OCL_NDRANGE(1);
-- 
1.9.1





More information about the Beignet mailing list