diff --git a/devito/symbolics/extended_sympy.py b/devito/symbolics/extended_sympy.py index 7ed801d17a..4087bbc72c 100644 --- a/devito/symbolics/extended_sympy.py +++ b/devito/symbolics/extended_sympy.py @@ -799,6 +799,14 @@ class UCHAR(Cast): _base_typ = 'unsigned char' +class UINT(Cast): + _base_typ = 'unsigned int' + + +class UINTP(CastStar): + base = UINT + + class LONG(Cast): _base_typ = 'long' diff --git a/devito/tools/dtypes_lowering.py b/devito/tools/dtypes_lowering.py index 4e7908a552..b5b564a4d7 100644 --- a/devito/tools/dtypes_lowering.py +++ b/devito/tools/dtypes_lowering.py @@ -138,7 +138,9 @@ def dtype_to_ctype(dtype): except KeyError: pass - if issubclass(dtype, ctypes._SimpleCData): + if isinstance(dtype, CustomDtype): + return dtype + elif issubclass(dtype, ctypes._SimpleCData): # Bypass np.ctypeslib's normalization rules such as # `np.ctypeslib.as_ctypes_type(ctypes.c_void_p) -> ctypes.c_ulong` return dtype