Skip to content

Commit

Permalink
For now, just compare distances with a tiny tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLevy committed Jun 12, 2024
1 parent fd000a7 commit 4546e98
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tests/test_nn_search/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ int main(int argc, char** argv) {
// does not optimize both functions the same way (happens on Mac/M1)
//
// --> Did not work, NOT UNDERSTOOD YET (probably need to play with compilation flags)
// --> Seems that indices neigh2[] are random
/*
for(index_t j=0; j < nb_neigh; ++j) {
index_t nn = neigh2[j];
Expand All @@ -170,8 +171,8 @@ 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.
// if(::fabs(sq_dist1[j] - sq_dist2[j]) > 1e-6) {
if(sq_dist1[j] != sq_dist2[j]) {
if(::fabs(sq_dist1[j] - sq_dist2[j]) > 1e-6) {
// if(sq_dist1[j] != sq_dist2[j]) {
has_mismatch = true;
match = false;
Logger::err("Mismatch") << i << "[" << j << "]"
Expand Down

0 comments on commit 4546e98

Please sign in to comment.