From 74af0da8c68c2e1cad622ff1c88e331978a6222d Mon Sep 17 00:00:00 2001 From: Mathias Louboutin Date: Mon, 4 Dec 2023 11:08:39 -0500 Subject: [PATCH] misc: fix short/ushort codegen --- devito/symbolics/extended_sympy.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/devito/symbolics/extended_sympy.py b/devito/symbolics/extended_sympy.py index 8616fd76d2..c827a990ac 100644 --- a/devito/symbolics/extended_sympy.py +++ b/devito/symbolics/extended_sympy.py @@ -675,6 +675,14 @@ class UCHARP(CastStar): base = UCHAR +class SHORTP(CastStar): + base = SHORT + + +class USHORTP(CastStar): + base = USHORT + + cast_mapper = { np.int8: CHAR, np.uint8: UCHAR, @@ -691,8 +699,8 @@ class UCHARP(CastStar): (np.int8, '*'): CHARP, (np.uint8, '*'): UCHARP, (int, '*'): INTP, # noqa - (np.uint16, '*'): INTP, # noqa - (np.int16, '*'): INTP, # noqa + (np.uint16, '*'): USHORTP, # noqa + (np.int16, '*'): SHORTP, # noqa (np.int32, '*'): INTP, # noqa (np.int64, '*'): INTP, # noqa (np.float32, '*'): FLOATP, # noqa