Skip to content

Commit

Permalink
BrokenLineFits and RiemannFit: mask asserts behind DEBUG flags
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Apr 23, 2024
1 parent 3fb8b0e commit 3c36fcd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
}
brokenline::fastFit(acc, hits, fast_fit);

// no NaN here....
ALPAKA_ASSERT_ACC(fast_fit(0) == fast_fit(0));
ALPAKA_ASSERT_ACC(fast_fit(1) == fast_fit(1));
ALPAKA_ASSERT_ACC(fast_fit(2) == fast_fit(2));
ALPAKA_ASSERT_ACC(fast_fit(3) == fast_fit(3));
#ifdef BROKENLINE_DEBUG
// any NaN value should cause the track to be rejected at a later stage
ALPAKA_ASSERT_ACC(not alpaka::math::isnan(acc, fast_fit(0)));
ALPAKA_ASSERT_ACC(not alpaka::math::isnan(acc, fast_fit(1)));
ALPAKA_ASSERT_ACC(not alpaka::math::isnan(acc, fast_fit(2)));
ALPAKA_ASSERT_ACC(not alpaka::math::isnan(acc, fast_fit(3)));
#endif
}
}
};
Expand Down
12 changes: 7 additions & 5 deletions RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
}
riemannFit::fastFit(acc, hits, fast_fit);

// no NaN here....
ALPAKA_ASSERT_ACC(fast_fit(0) == fast_fit(0));
ALPAKA_ASSERT_ACC(fast_fit(1) == fast_fit(1));
ALPAKA_ASSERT_ACC(fast_fit(2) == fast_fit(2));
ALPAKA_ASSERT_ACC(fast_fit(3) == fast_fit(3));
#ifdef RIEMANN_DEBUG
// any NaN value should cause the track to be rejected at a later stage
ALPAKA_ASSERT_ACC(not alpaka::math::isnan(acc, fast_fit(0)));
ALPAKA_ASSERT_ACC(not alpaka::math::isnan(acc, fast_fit(1)));
ALPAKA_ASSERT_ACC(not alpaka::math::isnan(acc, fast_fit(2)));
ALPAKA_ASSERT_ACC(not alpaka::math::isnan(acc, fast_fit(3)));
#endif
}
}
};
Expand Down

0 comments on commit 3c36fcd

Please sign in to comment.