Skip to content

Commit

Permalink
Used a wider NaN test to also cover possible Inf with -ofast
Browse files Browse the repository at this point in the history
  • Loading branch information
ericcano committed May 20, 2021
1 parent ffca428 commit 7153a96
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7153a96

Please sign in to comment.