-
Notifications
You must be signed in to change notification settings - Fork 230
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
compiler: Generate fminf/fmaxf where necessary #2501
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2501 +/- ##
==========================================
- Coverage 87.29% 87.29% -0.01%
==========================================
Files 238 238
Lines 45382 45395 +13
Branches 4031 4032 +1
==========================================
+ Hits 39616 39627 +11
- Misses 5083 5084 +1
- Partials 683 684 +1 ☔ View full report in Codecov by Sentry. |
|
||
# Check generated code -- ensure it's using the fp64 versions of min/max, | ||
# that is fminf/fmaxf | ||
assert all(i in str(op) for i in expected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be good (belt and braces) to also check:
assert all(i not in str(op) for i in not_expected)
to ensure that the correct versions are used throughout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overkill I'd say...
f = Function(name="f", grid=grid) | ||
g = Function(name="g", grid=grid) | ||
|
||
eqn = Eq(f, Min(g, 4.0) + Max(g, 2.0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would use numpy numbers to check dtype is correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdym exactly? I can think of at least two ways...
I landed on the above because that's the natural way people write the equations and it doesn't matter whether it's 4, 4.0, or 4.0F, because in the end, g
will drive the fmin/fmax
generation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mloubout I'm gonna merge this because I don't like broken CI, but as soon as you elaborate on how you want this test improved, I'll mkae the change and push it together with one of the upcoming branches (at least one more to go in before christmas)
No description provided.