From 47c17c44a2e0d492df18e867a3f2a96a06446ce6 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 20 Jun 2011 10:00:43 -0600 Subject: [PATCH] Accept "unsigned short int" and "short unsigned" and various related permutations. (Reported by Irwin Zaid.) --- pyopencl/tools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyopencl/tools.py b/pyopencl/tools.py index e9a6665c..43a60224 100644 --- a/pyopencl/tools.py +++ b/pyopencl/tools.py @@ -235,10 +235,11 @@ def parse_c_arg(c_arg): elif tp in ["int", "signed int"]: dtype = np.int32 elif tp in ["unsigned", "unsigned int"]: dtype = np.uint32 elif tp in ["long", "long int"]: dtype = np.int64 - elif tp in ["unsigned long", "unsigned long int"]: + elif tp in ["unsigned long", "unsigned long int", "long unsigned int"]: dtype = np.uint64 elif tp in ["short", "short int"]: dtype = np.int16 - elif tp in ["unsigned short", "unsigned short int"]: dtype = np.uint16 + elif tp in ["unsigned short", "unsigned short int", "short unsigned int"]: + dtype = np.uint16 elif tp in ["char", "signed char"]: dtype = np.int8 elif tp in ["unsigned char"]: dtype = np.uint8 elif tp in ["bool"]: dtype = np.bool -- GitLab