Analogous to https://github.com/inducer/pyopencl/issues/668. We probably want to restrict this checking to `__debug__` mode.
Analogous to inducer/pyopencl#668.
We probably want to restrict this checking to
__debug__mode.