inducer / pyopencl

OpenCL integration for Python, plus shiny features
http://mathema.tician.de/software/pyopencl
Other
1.06k stars 241 forks source link

Rework `_get_common_dtype` to tolerate unsized scalars, match numpy, warn about downcasts #604

Closed matthiasdiener closed 2 years ago

matthiasdiener commented 2 years ago

Otherwise, (e.g.) cla.minimum(scalar, array) won't work since scalar doesn't have a dtype attribute.

Fixes mirgecom execution with limiter.

Related to #592. This is a regression from 2022.1.6. The attached tests fail on current main.

MTCam commented 2 years ago

Fixes illinois-ceesd/mirgecom#747

inducer commented 2 years ago

I've reworked this a bit, and I'm inclined to merge it soon (tonight-ish) and release, assuming it passes CI. If you're around, I'd like it if you could give it a look.

inducer commented 2 years ago

https://pypi.org/project/pyopencl/2022.2.2/

matthiasdiener commented 2 years ago

I did a quick test of the reworked version, and it appears to fix https://github.com/illinois-ceesd/mirgecom/issues/747.