[Beignet] [PATCH] Fix a utest compiler_async_stride_copy typo.

Song, Ruiling ruiling.song at intel.com
Wed Aug 6 23:11:24 PDT 2014


The patch looks good to me.

Thanks!
Ruiling
-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Yang Rong
Sent: Monday, August 04, 2014 3:04 PM
To: beignet at lists.freedesktop.org
Cc: Yang, Rong R
Subject: [Beignet] [PATCH] Fix a utest compiler_async_stride_copy typo.

And need to convert to char when compare.

Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 utests/compiler_async_stride_copy.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/utests/compiler_async_stride_copy.cpp b/utests/compiler_async_stride_copy.cpp
index 132f917..2e9eaeb 100644
--- a/utests/compiler_async_stride_copy.cpp
+++ b/utests/compiler_async_stride_copy.cpp
@@ -19,7 +19,7 @@ static void compiler_async_stride_copy(void)
 
   OCL_MAP_BUFFER(1);
   for (uint32_t i = 0; i < n * copiesPerWorkItem * 4 * stride; ++i)
-      ((char*)buf_data[1])[i] = rand() && 0xff;
+      ((char*)buf_data[1])[i] = rand() & 0xff;
   OCL_UNMAP_BUFFER(1);
 
   // Run the kernel
@@ -33,10 +33,10 @@ static void compiler_async_stride_copy(void)
   char *dst = (char*)buf_data[0];
   char *src = (char*)buf_data[1];
   for (uint32_t i = 0; i < n * copiesPerWorkItem; i += stride * 4) {
-    OCL_ASSERT(dst[i + 0] == src[i + 0] + 3);
-    OCL_ASSERT(dst[i + 1] == src[i + 1] + 3);
-    OCL_ASSERT(dst[i + 2] == src[i + 2] + 3);
-    OCL_ASSERT(dst[i + 3] == src[i + 3] + 3);
+    OCL_ASSERT(dst[i + 0] == (char)(src[i + 0] + 3));
+    OCL_ASSERT(dst[i + 1] == (char)(src[i + 1] + 3));
+    OCL_ASSERT(dst[i + 2] == (char)(src[i + 2] + 3));
+    OCL_ASSERT(dst[i + 3] == (char)(src[i + 3] + 3));
   }
   OCL_UNMAP_BUFFER(0);
   OCL_UNMAP_BUFFER(1);
-- 
1.8.3.2

_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list