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
Apple M1 changes #788
Apple M1 changes #788
Conversation
@fabianschenk has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@@ -68,7 +68,11 @@ std::pair<bool, Eigen::Matrix<T, 3, 1>> TriangulateTwoBearingsMidpointSolve( | |||
|
|||
const T eps = T(1e-30); | |||
const T det = A.determinant(); | |||
#ifdef __aarch64__ | |||
if (std::abs<T>(det) < eps) { |
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.
@pierotofy
Thanks for your diff. Could you remove the #ifdef
and simply use the templated version as default:
if (std::abs<T>(det) < eps)
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.
Hey @fabianschenk ✋ thanks for the review, I actually started out by just having the templated version, but Visual Studio doesn't like it (read: it doesn't compile) on Windows.
I could replace the define to a #ifndef __MSVC__
?
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.
Hi @pierotofy ,
Thanks for the quick response and also for testing on Windows.
Then I'll land it like it is.
Thanks again for your contribution 👍
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.
Pleasure! OpenSfM is a great software.
@fabianschenk merged this pull request in d468471. |
Hey all ✋
While building and running OpenSfM on an Apple M1 I encountered a strange bug, which I narrowed down to to
geometry/triangulation.h:71
. Debugging a reconstruction showed that for some reason the compiler decided to assume std::abs should be of typeint
instead of typeT
, causing values to be truncated to0
at every computation.