Skip to content

Commit

Permalink
Custom type declarations: Do not attempt to redeclare vector types
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Aug 17, 2016
1 parent e499c28 commit c99e9b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyopencl/tools.py
Expand Up @@ -649,6 +649,11 @@ def dtype_to_c_struct(device, dtype):
if dtype.fields is None:
return ""

from pyopencl.array import vec
if dtype in vec.type_to_scalar_and_count:
# Vector types are built-in. Don't try to redeclare those.
return ""

matched_dtype, c_decl = match_dtype_to_c_struct(
device, dtype_to_ctype(dtype), dtype)

Expand Down

0 comments on commit c99e9b3

Please sign in to comment.