File indexing completed on 2024-04-06 12:28:16
0001 #ifndef RecoTracker_MkFitCore_interface_cms_common_macros_h
0002 #define RecoTracker_MkFitCore_interface_cms_common_macros_h
0003
0004 #ifdef MKFIT_STANDALONE
0005 #define CMS_SA_ALLOW
0006 #else
0007 #include "FWCore/Utilities/interface/thread_safety_macros.h"
0008 #include "FWCore/Utilities/interface/isFinite.h"
0009 #endif
0010
0011 namespace mkfit {
0012
0013 constexpr bool isFinite(float x) {
0014 #ifdef MKFIT_STANDALONE
0015 const unsigned int mask = 0x7f800000;
0016 union {
0017 unsigned int l;
0018 float d;
0019 } v = {.d = x};
0020 return (v.l & mask) != mask;
0021 #else
0022 return edm::isFinite(x);
0023 #endif
0024 }
0025
0026 }
0027
0028 #endif