-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect native NaN values, warn about them #911
Comments
Hmm, for the simple test in Lines 390 to 399 in 698f295
parse (and thus FunctionToPrimitiveMapper ) does not seem to be called with a nan argument. Is there a better place to perform this replacement?
|
On second thought, replacing "native" NaNs with pymbolic NaNs in one central location is probably not happening---there are too many possible "ways in", as you point out. My next idea was to warn about them at code gen time, but it turns out that this is already being done: loopy/loopy/target/c/codegen/expression.py Lines 441 to 450 in 698f295
The analogous check for Python is missing though: Lines 67 to 71 in 698f295
So that still needs to be added. Did you see the warning above? |
I can go ahead and this a warning there. Should this also do a
I did see the warning in some tests; it could probably be improved though:
|
Maybe just warn? I'm not sure Python code gen has really been tested for NaNs. If you're willing to take on that test, then sure, it's probably easiest to do NaN codegen via replacement. I agree with your warning improvements. |
x-ref: inducer/pytools#287
This might be a good place, though the mapper obviously would need to be renamed.
cc @matthiasdiener
The text was updated successfully, but these errors were encountered: