Skip to content

Commit

Permalink
MacOS/M1 nn_search test:
Browse files Browse the repository at this point in the history
  now adding the tolerance only if it is a M1.
  • Loading branch information
BrunoLevy committed Jun 13, 2024
1 parent 22182c6 commit 3c03abe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tests/test_nn_search/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
#include <geogram/mesh/mesh.h>
#include <geogram/mesh/mesh_io.h>

#if defined(GEO_OS_APPLE) && defined(__arm__)
#define GEO_APPLE_M1
#endif

int main(int argc, char** argv) {

using namespace GEO;
Expand Down Expand Up @@ -182,8 +186,11 @@ int main(int argc, char** argv) {
// Added tolerance: on Mac/M1 we got tiny differences,
// I think it is doing auto FMA here and there, to be
// checked.
#ifdef GEO_APPLE_M1
if(::fabs(sq_dist1[j] - sq_dist2[j]) > 1e-6) {
// if(sq_dist1[j] != sq_dist2[j]) {
#else
if(sq_dist1[j] != sq_dist2[j]) {
#endif
has_mismatch = true;
match = false;
Logger::err("Mismatch") << i << "[" << j << "]"
Expand Down

0 comments on commit 3c03abe

Please sign in to comment.