-
Notifications
You must be signed in to change notification settings - Fork 169
Fix AVX2 detection on other platforms #2912
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
Fix AVX2 detection on other platforms #2912
Conversation
Signed-off-by: Naveen Tatikonda <[email protected]>
Signed-off-by: Naveen Tatikonda <[email protected]>
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.
Looks good
Signed-off-by: Vikasht34 <[email protected]>
03fa8a6
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.
somehow I see just the Changelog file present in the file diff. Something is wrong here.
if (!Platform.isIntel() || Platform.isWindows()) { | ||
return isAVX2Supported = false; |
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.
how does this solves the NPE? is it like on windows even when user has disabled the AVX2 we were still checking isIntel || isWindows()
?
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.
This is just to terminate and return early. This is the detection logic which will check if user has enabled or disabled AVX2 based on OS.
NPE is happening when it is ran on some other platform like FreeBSD other than linux, windows and mac because the default value of isAVX2Supported
is null
. So, we are fixing it here by returning false if it is still null
Signed-off-by: Naveen Tatikonda <[email protected]> Signed-off-by: Vikasht34 <[email protected]> Co-authored-by: Vikasht34 <[email protected]>
Description
Fix NPE while detecting AVX2 on other platforms(other than Linux, Mac and Windows)
Related Issues
Resolves #2788
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.