Skip to content

Commit

Permalink
Improve struct layout discovery error message (Closes #130)
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Sep 3, 2016
1 parent 0d57440 commit 3128eb2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyopencl/tools.py
Expand Up @@ -604,7 +604,11 @@ def match_dtype_to_c_struct(device, name, dtype, context=None):
for field_name, dtype_and_offset in fields]
else:
raise RuntimeError(
"cannot discover struct layout on '%s'" % device)
"OpenCL compiler reported offsetof() past sizeof() "
"for struct layout on '%s'. "
"This makes no sense, and it's usually indicates a "
"compiler bug. "
"Refusing to discover struct layout." % device)

result_buf.data.release()
del knl
Expand Down

0 comments on commit 3128eb2

Please sign in to comment.