Skip to content

Commit

Permalink
Merge pull request #2271 from devitocodes/short-ctype
Browse files Browse the repository at this point in the history
compiler: Add missing numpy dtypes
  • Loading branch information
FabioLuporini authored Nov 21, 2023
2 parents b68cf6f + 747f4d0 commit 21ef56c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions devito/symbolics/extended_sympy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 21ef56c

Please sign in to comment.