Skip to content

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

Merged
inducer merged 2 commits into
inducer:mainfrom
matthiasdiener:sym-dtype
Sep 11, 2022
Merged

Rework _get_common_dtype to tolerate unsized scalars, match numpy, warn about downcasts#604
inducer merged 2 commits into
inducer:mainfrom
matthiasdiener:sym-dtype

Conversation

@matthiasdiener

@matthiasdiener matthiasdiener commented Sep 8, 2022

Copy link
Copy Markdown
Contributor

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.

@matthiasdiener matthiasdiener changed the title i_get_common_dtype: make it accept scalar as first argument _get_common_dtype: make it accept scalar as first argument Sep 8, 2022
@matthiasdiener matthiasdiener changed the title _get_common_dtype: make it accept scalar as first argument _get_common_dtype: accept scalar as first argument Sep 9, 2022
@MTCam

MTCam commented Sep 9, 2022

Copy link
Copy Markdown

Fixes illinois-ceesd/mirgecom#747

Comment thread pyopencl/array.py Outdated
@inducer inducer changed the title _get_common_dtype: accept scalar as first argument Rework _get_common_dtype to tolerate unsized scalars, match numpy, warn about downcasts Sep 11, 2022
@inducer

inducer commented Sep 11, 2022

Copy link
Copy Markdown
Owner

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 inducer merged commit 1f24376 into inducer:main Sep 11, 2022
@inducer

inducer commented Sep 11, 2022

Copy link
Copy Markdown
Owner

@matthiasdiener matthiasdiener deleted the sym-dtype branch September 11, 2022 04:26
@matthiasdiener

Copy link
Copy Markdown
Contributor Author

I did a quick test of the reworked version, and it appears to fix illinois-ceesd/mirgecom#747.

Comment thread pyopencl/array.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants