diff options
author | Yang Rong <rong.r.yang@intel.com> | 2014-09-01 13:05:05 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-09-02 10:11:19 +0800 |
commit | c98e3cba45cd47bdc15a7d7319fb4e7c30b51d7a (patch) | |
tree | 2bf6e261183d100530b9a7ecd09ab7da9590ddbb | |
parent | 6fc719b5c233a1b815889d68a98fe861777c7ca8 (diff) |
Two minor fix.
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>
-rw-r--r-- | backend/src/backend/program.cpp | 2 | ||||
-rwxr-xr-x | backend/src/gen_builtin_vector.py | 4 | ||||
-rw-r--r-- | src/cl_kernel.c | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp index a3b6b9d..500be37 100644 --- a/backend/src/backend/program.cpp +++ b/backend/src/backend/program.cpp @@ -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: diff --git a/backend/src/gen_builtin_vector.py b/backend/src/gen_builtin_vector.py index b100bbf..2d602c8 100755 --- a/backend/src/gen_builtin_vector.py +++ b/backend/src/gen_builtin_vector.py @@ -314,9 +314,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 += ')' diff --git a/src/cl_kernel.c b/src/cl_kernel.c index aad3c04..c30907e 100644 --- a/src/cl_kernel.c +++ b/src/cl_kernel.c @@ -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 |