Skip to content

Commit 6702b3b

Browse files
author
Diptorup Deb
committed
Update dpctl Cython API for new DPCTLKernelArgType
1 parent 1d9c7a9 commit 6702b3b

File tree

2 files changed

+23
-34
lines changed

2 files changed

+23
-34
lines changed

dpctl/_backend.pxd

+10-15
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,16 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
5757
_UNKNOWN_DEVICE 'DPCTL_UNKNOWN_DEVICE'
5858

5959
ctypedef enum _arg_data_type 'DPCTLKernelArgType':
60-
_CHAR 'DPCTL_CHAR',
61-
_SIGNED_CHAR 'DPCTL_SIGNED_CHAR',
62-
_UNSIGNED_CHAR 'DPCTL_UNSIGNED_CHAR',
63-
_SHORT 'DPCTL_SHORT',
64-
_INT 'DPCTL_INT',
65-
_UNSIGNED_INT 'DPCTL_UNSIGNED_INT',
66-
_UNSIGNED_INT8 'DPCTL_UNSIGNED_INT8',
67-
_LONG 'DPCTL_LONG',
68-
_UNSIGNED_LONG 'DPCTL_UNSIGNED_LONG',
69-
_LONG_LONG 'DPCTL_LONG_LONG',
70-
_UNSIGNED_LONG_LONG 'DPCTL_UNSIGNED_LONG_LONG',
71-
_SIZE_T 'DPCTL_SIZE_T',
72-
_FLOAT 'DPCTL_FLOAT',
73-
_DOUBLE 'DPCTL_DOUBLE',
74-
_LONG_DOUBLE 'DPCTL_DOUBLE',
60+
_INT8_T 'DPCTL_INT8_T',
61+
_UINT8_T 'DPCTL_UINT8_T',
62+
_INT16_T 'DPCTL_INT16_T',
63+
_UINT16_T 'DPCTL_UINT16_T',
64+
_INT32_T 'DPCTL_INT32_T',
65+
_UINT32_T 'DPCTL_UINT32_T',
66+
_INT64_T 'DPCTL_INT64_T',
67+
_UINT64_T 'DPCTL_UINT64_T',
68+
_FLOAT 'DPCTL_FLOAT32_T',
69+
_DOUBLE 'DPCTL_FLOAT64_T',
7570
_VOID_PTR 'DPCTL_VOID_PTR'
7671

7772
ctypedef enum _queue_property_type 'DPCTLQueuePropertyType':

dpctl/_sycl_queue.pyx

+13-19
Original file line numberDiff line numberDiff line change
@@ -631,34 +631,28 @@ cdef class SyclQueue(_SyclQueue):
631631
for idx, arg in enumerate(args):
632632
if isinstance(arg, ctypes.c_char):
633633
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
634-
kargty[idx] = _arg_data_type._CHAR
635-
elif isinstance(arg, ctypes.c_int):
634+
kargty[idx] = _arg_data_type._INT8_T
635+
elif isinstance(arg, ctypes.c_uint8):
636636
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
637-
kargty[idx] = _arg_data_type._INT
638-
elif isinstance(arg, ctypes.c_uint):
637+
kargty[idx] = _arg_data_type._UINT8_T
638+
elif isinstance(arg, ctypes.c_short):
639639
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
640-
kargty[idx] = _arg_data_type._UNSIGNED_INT
641-
elif isinstance(arg, ctypes.c_uint8):
640+
kargty[idx] = _arg_data_type._INT16_T
641+
elif isinstance(arg, ctypes.c_ushort):
642642
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
643-
kargty[idx] = _arg_data_type._UNSIGNED_INT8
644-
elif isinstance(arg, ctypes.c_long):
643+
kargty[idx] = _arg_data_type._UINT16_T
644+
elif isinstance(arg, ctypes.c_int):
645645
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
646-
kargty[idx] = _arg_data_type._LONG
647-
elif isinstance(arg, ctypes.c_ulong):
646+
kargty[idx] = _arg_data_type._INT32_T
647+
elif isinstance(arg, ctypes.c_uint):
648648
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
649-
kargty[idx] = _arg_data_type._UNSIGNED_LONG
649+
kargty[idx] = _arg_data_type._UINT32_T
650650
elif isinstance(arg, ctypes.c_longlong):
651651
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
652-
kargty[idx] = _arg_data_type._LONG_LONG
652+
kargty[idx] = _arg_data_type._INT64_T
653653
elif isinstance(arg, ctypes.c_ulonglong):
654654
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
655-
kargty[idx] = _arg_data_type._UNSIGNED_LONG_LONG
656-
elif isinstance(arg, ctypes.c_short):
657-
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
658-
kargty[idx] = _arg_data_type._SHORT
659-
elif isinstance(arg, ctypes.c_size_t):
660-
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
661-
kargty[idx] = _arg_data_type._SIZE_T
655+
kargty[idx] = _arg_data_type._UINT64_T
662656
elif isinstance(arg, ctypes.c_float):
663657
kargs[idx] = <void*><size_t>(ctypes.addressof(arg))
664658
kargty[idx] = _arg_data_type._FLOAT

0 commit comments

Comments
 (0)