-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
BUG: Fix np.clip bug NaN handling for Visual Studio 2015 #7678
BUG: Fix np.clip bug NaN handling for Visual Studio 2015 #7678
Conversation
by disabling loop vectorization and add test.
hm, the bug says this is supposed to be fixed in vs2015, is 1900 the 2015 version? |
Short answer is yes. Long answer: from https://msdn.microsoft.com/en-us/library/b0084kay.aspx about _MSC_VER:
|
but this disables vectorization for 2015 then which is supposed to be fixed. |
Hmm, where do you get the impression that vectorization is supposed to be fixed in VS 2015? According to the ticket I opened at connect.microsoft.com there, one person from Microsoft acknowledged that there was a bug in the latest version of the compiler:
|
|
The message you copied and pasted was posted 40 minutes before the one I copied and pasted. Confusingly the latest message is at the top in their bug tracker ... |
oh, that is a bit confusing. Looks good then, thanks for investigating and reporting the issue. |
@charris probably worth a backport to 11.1, low risk and having it in a stable release soon helps with appveyor tests of other projects |
That would be great indeed! |
@@ -3763,6 +3763,12 @@ static void | |||
} | |||
} | |||
else { | |||
// Visual Studio 2015 loop vectorizer handles NaN in an unexpected manner, see: |
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.
Need to fix the C++ comments. I'll do that.
Does the pragma only apply to the following EDIT: nvm, looked it up and it is following loop specific. |
I have encountered a similar issue on POWER9 with GCC 9.3.0 and numpy 1.16.6 (Python 2) where GCC misoptimizes #7601 (comment) so it yields the upper bound on NaN at |
Fix #7601.
The work-around is to disable the loop vectorization for Visual studio 2015. Let me know if there is a better way to achieve the same results.
I added a test that highlights the issue (only python 3.5).
In a separate branch I made sure that the test was failing without the loop vectorization disabled: AppVeyor build.
and that disabling the loop vectorization fixed the problem: AppVeyor build.