Skip to content

Commit 7f7b090

Browse files
authored
Fix/issue 83 (#96)
* Add support for uint8 and ulong.
1 parent 251f135 commit 7f7b090

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

backends/include/dppl_sycl_enum_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ typedef enum
7676
DPPL_SHORT,
7777
DPPL_INT,
7878
DPPL_UNSIGNED_INT,
79+
DPPL_UNSIGNED_INT8,
7980
DPPL_LONG,
8081
DPPL_UNSIGNED_LONG,
8182
DPPL_LONG_LONG,

backends/source/dppl_sycl_queue_interface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ bool set_kernel_arg (handler &cgh, size_t idx, __dppl_keep void *Arg,
7272
case DPPL_UNSIGNED_INT:
7373
cgh.set_arg(idx, *(unsigned int*)Arg);
7474
break;
75+
case DPPL_UNSIGNED_INT8:
76+
cgh.set_arg(idx, *(uint8_t*)Arg);
77+
break;
7578
case DPPL_LONG:
7679
cgh.set_arg(idx, *(long*)Arg);
7780
break;

dpctl/backend.pxd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ cdef extern from "dppl_sycl_enum_types.h":
5757
_UNSIGNED_CHAR 'DPPL_UNSIGNED_CHAR',
5858
_SHORT 'DPPL_SHORT',
5959
_INT 'DPPL_INT',
60-
_UNSIGNED_INT 'DPPL_INT',
60+
_UNSIGNED_INT 'DPPL_UNSIGNED_INT',
61+
_UNSIGNED_INT8 'DPPL_UNSIGNED_INT8',
6162
_LONG 'DPPL_LONG',
6263
_UNSIGNED_LONG 'DPPL_UNSIGNED_LONG',
6364
_LONG_LONG 'DPPL_LONG_LONG',

dpctl/sycl_core.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,15 @@ cdef class SyclQueue:
294294
elif isinstance(arg, ctypes.c_uint):
295295
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
296296
kargty[idx] = _arg_data_type._UNSIGNED_INT
297+
elif isinstance(arg, ctypes.c_uint8):
298+
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
299+
kargty[idx] = _arg_data_type._UNSIGNED_INT8
297300
elif isinstance(arg, ctypes.c_long):
298301
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
299302
kargty[idx] = _arg_data_type._LONG
303+
elif isinstance(arg, ctypes.c_ulong):
304+
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
305+
kargty[idx] = _arg_data_type._UNSIGNED_LONG
300306
elif isinstance(arg, ctypes.c_longlong):
301307
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
302308
kargty[idx] = _arg_data_type._LONG_LONG

0 commit comments

Comments
 (0)