From 7153a96b19d3d644c5513f74284a2e52eca0d32d Mon Sep 17 00:00:00 2001 From: Eric Cano Date: Thu, 15 Apr 2021 11:23:09 +0200 Subject: [PATCH] Used a wider NaN test to also cover possible Inf with -ofast https://github.com/cms-sw/cmssw/pull/31722#discussion_r603678116 --- .../plugins/CAHitNtupletGeneratorKernelsImpl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorKernelsImpl.h b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorKernelsImpl.h index 424ab7c3c1e7f..b93e50b6753c3 100644 --- a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorKernelsImpl.h +++ b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorKernelsImpl.h @@ -12,6 +12,7 @@ #include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" #include "HeterogeneousCore/CUDAUtilities/interface/cuda_assert.h" #include "RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforGPU.h" +#include "FWCore/Utilities/interface/isFinite.h" #include "CAConstants.h" #include "CAHitNtupletGeneratorKernels.h" @@ -355,11 +356,11 @@ __global__ void kernel_classifyTracks(HitContainer const *__restrict__ tuples, continue; // if the fit has any invalid parameters, mark it as bad - bool isNaN = false; + bool isNotFinite = false; for (int i = 0; i < 5; ++i) { - isNaN |= std::isnan(tracks->stateAtBS().state(it)(i)); + isNotFinite |= edm::isNotFinite(tracks->stateAtBS().state(it)(i)); } - if (isNaN) { + if (isNotFinite) { #ifdef NTUPLE_DEBUG printf("NaN in fit %d size %d chi2 %f\n", it, tuples->size(it), tracks->chi2(it)); #endif