Two minor fix.
authorYang Rong <rong.r.yang@intel.com>
Mon, 1 Sep 2014 05:05:05 +0000 (13:05 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Tue, 2 Sep 2014 01:57:08 +0000 (09:57 +0800)
1. Some systems don't define ulong type, use unsigned long instead of..
2. Use sA, sB... instead of sa, sb... to access vector 16, because sometimes sa, sb will cause clang error.

Signed-off-by: Yang Rong <rong.r.yang@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
backend/src/backend/program.cpp
backend/src/gen_builtin_vector.py
src/cl_kernel.c

index d992f7b..20471f9 100644 (file)
@@ -1000,7 +1000,7 @@ namespace gbe {
 
     switch (value) {
       case GBE_GET_ARG_INFO_ADDRSPACE:
-        return (void*)((ulong)info->addrSpace);
+        return (void*)((unsigned long)info->addrSpace);
       case GBE_GET_ARG_INFO_TYPE:
         return (void *)(info->typeName.c_str());
       case GBE_GET_ARG_INFO_ACCESS:
index 5f1c4b7..dd530a0 100755 (executable)
@@ -347,9 +347,9 @@ class builtinProto():
                     formatStr += '({0} {1} *)param{2} + {3:2d}'.format(ptype[2], ptype[0], n, j)
                 else:
                     if (self.functionName == 'select' and n == 2):
-                        formatStr += '({0})(param{1}.s{2:x} & (({0})1 << (sizeof({0})*8 - 1)))'.format(ptype[0], n, j)
+                        formatStr += '({0})(param{1}.s{2:X} & (({0})1 << (sizeof({0})*8 - 1)))'.format(ptype[0], n, j)
                     else:
-                        formatStr += 'param{0}.s{1:x}'.format(n, j)
+                        formatStr += 'param{0}.s{1:X}'.format(n, j)
 
             formatStr += ')'
 
index 94b834b..5ab9c55 100644 (file)
@@ -225,13 +225,13 @@ cl_get_kernel_arg_info(cl_kernel k, cl_uint arg_index, cl_kernel_arg_info param_
     if (param_value_size_ret)
       *param_value_size_ret = sizeof(cl_kernel_arg_address_qualifier);
     if (!param_value) return CL_SUCCESS;
-    if ((ulong)ret_info == 0) {
+    if ((cl_ulong)ret_info == 0) {
       *(cl_kernel_arg_address_qualifier *)param_value = CL_KERNEL_ARG_ADDRESS_PRIVATE;
-    } else if ((ulong)ret_info == 1 || (ulong)ret_info == 4) {
+    } else if ((cl_ulong)ret_info == 1 || (cl_ulong)ret_info == 4) {
       *(cl_kernel_arg_address_qualifier *)param_value = CL_KERNEL_ARG_ADDRESS_GLOBAL;
-    } else if ((ulong)ret_info == 2) {
+    } else if ((cl_ulong)ret_info == 2) {
       *(cl_kernel_arg_address_qualifier *)param_value = CL_KERNEL_ARG_ADDRESS_CONSTANT;
-    } else if ((ulong)ret_info == 3) {
+    } else if ((cl_ulong)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