[Beignet] [PATCH] Silence some compilation warnings.

Yang, Rong R rong.r.yang at intel.com
Tue May 27 23:41:23 PDT 2014


LGTM, thanks.

-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Zhigang Gong
Sent: Wednesday, May 28, 2014 10:31 AM
To: beignet at lists.freedesktop.org
Cc: Gong, Zhigang
Subject: [Beignet] [PATCH] Silence some compilation warnings.

Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
 src/cl_mem.c                  | 6 +++---
 utests/compiler_local_slm.cpp | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/cl_mem.c b/src/cl_mem.c index 87ea317..9e7bfc9 100644
--- a/src/cl_mem.c
+++ b/src/cl_mem.c
@@ -989,7 +989,7 @@ LOCAL cl_int
 cl_mem_kernel_copy_image(cl_command_queue queue, struct _cl_mem_image* src_image, struct _cl_mem_image* dst_image,
                          const size_t *src_origin, const size_t *dst_origin, const size_t *region) {
   cl_int ret;
-  cl_kernel ker;
+  cl_kernel ker = NULL;
   size_t global_off[] = {0,0,0};
   size_t global_sz[] = {1,1,1};
   size_t local_sz[] = {LOCAL_SZ_0,LOCAL_SZ_1,LOCAL_SZ_2};
@@ -1090,7 +1090,7 @@ LOCAL cl_int
 cl_mem_copy_image_to_buffer(cl_command_queue queue, struct _cl_mem_image* image, cl_mem buffer,
                          const size_t *src_origin, const size_t dst_offset, const size_t *region) {
   cl_int ret;
-  cl_kernel ker;
+  cl_kernel ker = NULL;
   size_t global_off[] = {0,0,0};
   size_t global_sz[] = {1,1,1};
   size_t local_sz[] = {LOCAL_SZ_0,LOCAL_SZ_1,LOCAL_SZ_2};
@@ -1164,7 +1164,7 @@ LOCAL cl_int
 cl_mem_copy_buffer_to_image(cl_command_queue queue, cl_mem buffer, struct _cl_mem_image* image,
                          const size_t src_offset, const size_t *dst_origin, const size_t *region) {
   cl_int ret;
-  cl_kernel ker;
+  cl_kernel ker = NULL;
   size_t global_off[] = {0,0,0};
   size_t global_sz[] = {1,1,1};
   size_t local_sz[] = {LOCAL_SZ_0,LOCAL_SZ_1,LOCAL_SZ_2};
diff --git a/utests/compiler_local_slm.cpp b/utests/compiler_local_slm.cpp index 48a072f..3a0c1ed 100644
--- a/utests/compiler_local_slm.cpp
+++ b/utests/compiler_local_slm.cpp
@@ -11,8 +11,7 @@ void compiler_local_slm(void)
   OCL_NDRANGE(1);
   OCL_MAP_BUFFER(0);
   for (uint32_t i = 0; i < n; ++i)
-//    std::cout << ((int32_t*)buf_data[0])[i] << std::endl;
-    OCL_ASSERT(((int32_t*)buf_data[0])[i] == (i%16 + 2 + 1+ i/16));
+    OCL_ASSERT(((uint32_t*)buf_data[0])[i] == (i%16 + 2 + 1+ i/16));
   OCL_UNMAP_BUFFER(0);
 }
 
--
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