Skip to content

Commit 3d752f0

Browse files
committed
codegen: Handle opaque types in c99 preamble
1 parent 4142eb5 commit 3d752f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

loopy/target/c/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ def dtype_to_ctype(self, dtype):
8080
# {{{ preamble generator
8181

8282
def c99_preamble_generator(preamble_info):
83+
from loopy.types import to_loopy_type
8384
if any(dtype.is_integral() for dtype in preamble_info.seen_dtypes):
8485
yield("10_stdint", "#include <stdint.h>")
85-
if any(dtype.numpy_dtype == np.dtype("bool")
86+
if any(dtype == to_loopy_type(np.dtype("bool"))
8687
for dtype in preamble_info.seen_dtypes):
8788
yield("10_stdbool", "#include <stdbool.h>")
8889
if any(dtype.is_complex() for dtype in preamble_info.seen_dtypes):

0 commit comments

Comments
 (0)