[Beignet] [PATCH] eliminate build warnings in i386 system.

Yang Rong rong.r.yang at intel.com
Thu Dec 8 10:02:51 UTC 2016


From: Meng Mengmeng <mengmeng.meng at intel.com>

Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 backend/src/ir/profiling.cpp | 2 +-
 src/cl_command_queue_gen7.c  | 2 +-
 src/cl_kernel.c              | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/backend/src/ir/profiling.cpp b/backend/src/ir/profiling.cpp
index 09537fa..413ed40 100644
--- a/backend/src/ir/profiling.cpp
+++ b/backend/src/ir/profiling.cpp
@@ -58,7 +58,7 @@ namespace ir
       proLog = ((proLog << 32) & 0xffffffff00000000) + log->timestampPrologLo;
       uint64_t epiLog = log->timestampEpilogHi;
       epiLog = ((epiLog << 32) & 0xffffffff00000000) + log->timestampEpilogLo;
-      printf(" | dispatch Mask:%4x prolog:%10lu  epilog:%10lu |\n", log->dispatchMask, proLog, epiLog);
+      printf(" | dispatch Mask:%4x prolog:%10llu  epilog:%10llu |\n", log->dispatchMask, proLog, epiLog);
 
       printf(" | globalX:%4d~%4d  globalY:%4d~%4d  globalZ:%4d~%4d |\n", log->gidXStart, log->gidXEnd,
           log->gidYStart, log->gidYEnd, log->gidZStart, log->gidZEnd);
diff --git a/src/cl_command_queue_gen7.c b/src/cl_command_queue_gen7.c
index 4487360..3316375 100644
--- a/src/cl_command_queue_gen7.c
+++ b/src/cl_command_queue_gen7.c
@@ -133,7 +133,7 @@ cl_upload_constant_buffer(cl_command_queue queue, cl_kernel ker, cl_gpgpu gpgpu)
     if (constant_addrspace >= 0) {
       size_t global_const_size = interp_program_get_global_constant_size(ker->program->opaque);
       if (global_const_size > 0) {
-        *(uint64_t*)(ker->curbe + constant_addrspace) = (uint64_t)ker->program->global_data_ptr;
+        *(char **)(ker->curbe + constant_addrspace) = ker->program->global_data_ptr;
         cl_gpgpu_bind_buf(gpgpu, ker->program->global_data, constant_addrspace, 0, ALIGN(global_const_size, getpagesize()), BTI_CONSTANT);
       }
     }
diff --git a/src/cl_kernel.c b/src/cl_kernel.c
index 49bbaf0..6fb4a7e 100644
--- a/src/cl_kernel.c
+++ b/src/cl_kernel.c
@@ -337,13 +337,13 @@ cl_get_kernel_arg_info(cl_kernel k, cl_uint arg_index, cl_kernel_arg_info param_
     if (!param_value) return CL_SUCCESS;
     if (param_value_size < sizeof(cl_kernel_arg_address_qualifier))
       return CL_INVALID_VALUE;
-    if ((cl_ulong)ret_info == 0) {
+    if ((size_t)ret_info == 0) {
       *(cl_kernel_arg_address_qualifier *)param_value = CL_KERNEL_ARG_ADDRESS_PRIVATE;
-    } else if ((cl_ulong)ret_info == 1 || (cl_ulong)ret_info == 4) {
+    } else if ((size_t)ret_info == 1 || (size_t)ret_info == 4) {
       *(cl_kernel_arg_address_qualifier *)param_value = CL_KERNEL_ARG_ADDRESS_GLOBAL;
-    } else if ((cl_ulong)ret_info == 2) {
+    } else if ((size_t)ret_info == 2) {
       *(cl_kernel_arg_address_qualifier *)param_value = CL_KERNEL_ARG_ADDRESS_CONSTANT;
-    } else if ((cl_ulong)ret_info == 3) {
+    } else if ((size_t)ret_info == 3) {
       *(cl_kernel_arg_address_qualifier *)param_value = CL_KERNEL_ARG_ADDRESS_LOCAL;
     } else {
       /* If no address qualifier is specified, the default address qualifier
-- 
2.1.4



More information about the Beignet mailing list