From 3c36fcde9d052990660773c2bb8394ce01dcb600 Mon Sep 17 00:00:00 2001 From: mmusich Date: Mon, 22 Apr 2024 17:01:21 +0200 Subject: [PATCH] BrokenLineFits and RiemannFit: mask asserts behind DEBUG flags --- .../PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc | 12 +++++++----- .../PixelSeeding/plugins/alpaka/RiemannFit.dev.cc | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc b/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc index dfb413f1e9258..f8cadf653114d 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc @@ -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 } } }; diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc b/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc index c6b7af5bccf67..3e6f6e9c8ed98 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc @@ -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 } } };