-
Notifications
You must be signed in to change notification settings - Fork 646
Fix portable library build on Windows #13260
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
base: gh/GregoryComer/117/head
Are you sure you want to change the base?
Conversation
Stack from ghstack (oldest at bottom): |
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13260
Note: Links to docs will display an error until the docs builds have been completed. ❌ 5 New Failures, 1 Unrelated FailureAs of commit 6e6ab75 with merge base 4ce7078 ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@manuelcandales Any thoughts or preference on the approach used here? |
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.
I was skeptical, but Google (and Godbolt https://godbolt.org/z/Tq8Tr9aWz) confirms this is a well-documented problem that happens when using MSVC. Thanks!
Enable build of the portable operator library (and executor_runner, now that we have portable) on the Windows preset. There are a couple of patterns that weren't building on Windows. Both std::nan and std::signbit complain about ambiguous overload resolution when given an integer argument.
To solve the std::isnan issue, I introduced isnan_override in math_util.h, following the naming pattern from max_override / min_override / etc. in the same file. It adds a specialized branch for integers to avoid calling std::isnan. For std::signbit, I just locally specialized.