Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler: Add missing symbolic casts #2462

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions devito/symbolics/extended_sympy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
4 changes: 3 additions & 1 deletion devito/tools/dtypes_lowering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading