From 747f4d064a3306473dd2b085c4b6403c327de28e Mon Sep 17 00:00:00 2001 From: mloubout Date: Mon, 20 Nov 2023 23:52:21 -0500 Subject: [PATCH] compiler: add missing numpy dtypes --- devito/symbolics/extended_sympy.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/devito/symbolics/extended_sympy.py b/devito/symbolics/extended_sympy.py index 654def1e98..6ad84a4bf5 100644 --- a/devito/symbolics/extended_sympy.py +++ b/devito/symbolics/extended_sympy.py @@ -619,6 +619,14 @@ class CHAR(Cast): _base_typ = 'char' +class SHORT(Cast): + _base_typ = 'short' + + +class USHORT(Cast): + _base_typ = 'unsigned short' + + class LONG(Cast): _base_typ = 'long' @@ -638,6 +646,8 @@ class CHARP(CastStar): cast_mapper = { np.int8: CHAR, np.uint8: CHAR, + np.int16: SHORT, # noqa + np.uint16: USHORT, # noqa int: INT, # noqa np.int32: INT, # noqa np.int64: LONG, @@ -649,6 +659,8 @@ class CHARP(CastStar): (np.int8, '*'): CHARP, (np.uint8, '*'): CHARP, (int, '*'): INTP, # noqa + (np.uint16, '*'): INTP, # noqa + (np.int16, '*'): INTP, # noqa (np.int32, '*'): INTP, # noqa (np.int64, '*'): INTP, # noqa (np.float32, '*'): FLOATP, # noqa