diff --git a/HeterogeneousCore/CUDAServices/src/CachingHostAllocator.h b/HeterogeneousCore/CUDAServices/src/CachingHostAllocator.h index 97be93c79131a..60cdf8bbbb617 100644 --- a/HeterogeneousCore/CUDAServices/src/CachingHostAllocator.h +++ b/HeterogeneousCore/CUDAServices/src/CachingHostAllocator.h @@ -142,18 +142,18 @@ struct CachingHostAllocator bytes(0), bin(INVALID_BIN), device(INVALID_DEVICE_ORDINAL), - associated_stream(0), - ready_event(0) + associated_stream(nullptr), + ready_event(nullptr) {} // Constructor (suitable for searching maps for a range of suitable blocks) BlockDescriptor() : - d_ptr(NULL), + d_ptr(nullptr), bytes(0), bin(INVALID_BIN), device(INVALID_DEVICE_ORDINAL), - associated_stream(0), - ready_event(0) + associated_stream(nullptr), + ready_event(nullptr) {} // Comparison functor for comparing host pointers @@ -348,9 +348,9 @@ struct CachingHostAllocator cudaError_t HostAllocate( void **d_ptr, ///< [out] Reference to pointer to the allocation size_t bytes, ///< [in] Minimum number of bytes for the allocation - cudaStream_t active_stream = 0) ///< [in] The stream to be associated with this allocation + cudaStream_t active_stream = nullptr) ///< [in] The stream to be associated with this allocation { - *d_ptr = NULL; + *d_ptr = nullptr; int device = INVALID_DEVICE_ORDINAL; cudaError_t error = cudaSuccess; diff --git a/HeterogeneousCore/Producer/interface/HeterogeneousEDProducer.h b/HeterogeneousCore/Producer/interface/HeterogeneousEDProducer.h index 4f06571e8a70d..4da113b4f15cd 100644 --- a/HeterogeneousCore/Producer/interface/HeterogeneousEDProducer.h +++ b/HeterogeneousCore/Producer/interface/HeterogeneousEDProducer.h @@ -172,7 +172,7 @@ class HeterogeneousEDProducer: public Devices, public edm::stream::EDProducer("heterogeneousEnabled_")) {} - ~HeterogeneousEDProducer() = default; + ~HeterogeneousEDProducer() override = default; protected: edm::EDGetTokenT consumesHeterogeneous(const edm::InputTag& tag) { @@ -187,11 +187,11 @@ class HeterogeneousEDProducer: public Devices, public edm::stream::EDProducer products; @@ -213,7 +213,7 @@ class HeterogeneousEDProducer: public Devices, public edm::stream::EDProducer > { public: explicit TestGPUConcurrency(edm::ParameterSet const& config); - ~TestGPUConcurrency() = default; + ~TestGPUConcurrency() override = default; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); diff --git a/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerAnalyzer.cc b/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerAnalyzer.cc index f07ceaba66d6e..18f3e4437eb80 100644 --- a/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerAnalyzer.cc +++ b/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerAnalyzer.cc @@ -12,7 +12,7 @@ class TestHeterogeneousEDProducerAnalyzer: public edm::global::EDAnalyzer<> { public: explicit TestHeterogeneousEDProducerAnalyzer(edm::ParameterSet const& iConfig); - ~TestHeterogeneousEDProducerAnalyzer() = default; + ~TestHeterogeneousEDProducerAnalyzer() override = default; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); diff --git a/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerGPU.cc b/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerGPU.cc index b92fa76614e85..7ee2e07b397ca 100644 --- a/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerGPU.cc +++ b/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerGPU.cc @@ -33,7 +33,7 @@ class TestHeterogeneousEDProducerGPU: public HeterogeneousEDProducer > { public: explicit TestHeterogeneousEDProducerGPU(edm::ParameterSet const& iConfig); - ~TestHeterogeneousEDProducerGPU() = default; + ~TestHeterogeneousEDProducerGPU() override = default; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); diff --git a/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerGPUMock.cc b/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerGPUMock.cc index c19e66bd1fbc1..8be516ccbba8e 100644 --- a/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerGPUMock.cc +++ b/HeterogeneousCore/Producer/test/TestHeterogeneousEDProducerGPUMock.cc @@ -26,7 +26,7 @@ class TestHeterogeneousEDProducerGPUMock: public HeterogeneousEDProducer > { public: explicit TestHeterogeneousEDProducerGPUMock(edm::ParameterSet const& iConfig); - ~TestHeterogeneousEDProducerGPUMock() = default; + ~TestHeterogeneousEDProducerGPUMock() override = default; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); @@ -44,7 +44,7 @@ class TestHeterogeneousEDProducerGPUMock: public HeterogeneousEDProducer callback); + void acquireGPUMock(const edm::HeterogeneousEvent& iEvent, const edm::EventSetup& iSetup, std::function callback) override; void produceCPU(edm::HeterogeneousEvent& iEvent, const edm::EventSetup& iSetup) override; void produceGPUMock(edm::HeterogeneousEvent& iEvent, const edm::EventSetup& iSetup) override; diff --git a/HeterogeneousCore/Product/interface/HeterogeneousProduct.h b/HeterogeneousCore/Product/interface/HeterogeneousProduct.h index a75c0cb52e6f9..c43f75a86b46f 100644 --- a/HeterogeneousCore/Product/interface/HeterogeneousProduct.h +++ b/HeterogeneousCore/Product/interface/HeterogeneousProduct.h @@ -119,7 +119,7 @@ namespace heterogeneous { static bool call(const FunctionTuple& functionTuple, ProductTuple& productTuple, const BitSetArray& bitsetArray) { constexpr const auto index = std::tuple_size::value - sizeMinusIndex; if(bitsetArray[index].any()) { - const auto func = std::get(functionTuple); + const auto& func = std::get(functionTuple); if(!func) { throw cms::Exception("Assert") << "Attempted to call transfer-to-CPU function for device " << index << " but the std::function object is not valid!"; } diff --git a/HeterogeneousCore/Product/test/testHeterogeneousProduct.cpp b/HeterogeneousCore/Product/test/testHeterogeneousProduct.cpp index eb946195079ae..adf8753316fd9 100644 --- a/HeterogeneousCore/Product/test/testHeterogeneousProduct.cpp +++ b/HeterogeneousCore/Product/test/testHeterogeneousProduct.cpp @@ -14,8 +14,8 @@ class testHeterogeneousProduct: public CppUnit::TestFixture { CPPUNIT_TEST(testProduct); CPPUNIT_TEST_SUITE_END(); public: - void setUp() {} - void tearDown() {} + void setUp() override {} + void tearDown() override {} void testDefault(); void testCPU(); diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelDigiHeterogeneousConverter.cc b/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelDigiHeterogeneousConverter.cc index 86214e830c5d1..149aab2bad1f8 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelDigiHeterogeneousConverter.cc +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelDigiHeterogeneousConverter.cc @@ -20,7 +20,7 @@ class SiPixelDigiHeterogeneousConverter: public edm::global::EDProducer<> { public: explicit SiPixelDigiHeterogeneousConverter(edm::ParameterSet const& iConfig); - ~SiPixelDigiHeterogeneousConverter() = default; + ~SiPixelDigiHeterogeneousConverter() override = default; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); diff --git a/RecoLocalTracker/SiPixelClusterizer/src/SiPixelFedCablingMapGPUWrapper.cc b/RecoLocalTracker/SiPixelClusterizer/src/SiPixelFedCablingMapGPUWrapper.cc index 1f872f3cb7464..d43ebfb3c7192 100644 --- a/RecoLocalTracker/SiPixelClusterizer/src/SiPixelFedCablingMapGPUWrapper.cc +++ b/RecoLocalTracker/SiPixelClusterizer/src/SiPixelFedCablingMapGPUWrapper.cc @@ -147,7 +147,7 @@ void SiPixelFedCablingMapGPUWrapper::ModulesToUnpack::fillAsync(SiPixelFedCablin path = {fed, link, roc}; const sipixelobjects::PixelROC* pixelRoc = cabling->findItem(path); if (pixelRoc != nullptr) { - modToUnpHost[index] = (modules.size() != 0) && (modules.find(pixelRoc->rawId()) == modules.end()); + modToUnpHost[index] = (not modules.empty()) and (modules.find(pixelRoc->rawId()) == modules.end()); } else { // store some dummy number modToUnpHost[index] = true; } diff --git a/RecoLocalTracker/SiPixelRecHits/interface/PixelCPEFast.h b/RecoLocalTracker/SiPixelRecHits/interface/PixelCPEFast.h index 35a3e6bf2a82c..5e206d9d5bd0b 100644 --- a/RecoLocalTracker/SiPixelRecHits/interface/PixelCPEFast.h +++ b/RecoLocalTracker/SiPixelRecHits/interface/PixelCPEFast.h @@ -41,7 +41,7 @@ class PixelCPEFast final : public PixelCPEBase const SiPixelGenErrorDBObject *, const SiPixelLorentzAngle *); - ~PixelCPEFast(); + ~PixelCPEFast() override; // The return value can only be used safely in kernels launched on // the same cudaStream, or after cudaStreamSynchronize. diff --git a/RecoPixelVertexing/PixelTrackFitting/interface/PixelFitterByRiemannParaboloid.h b/RecoPixelVertexing/PixelTrackFitting/interface/PixelFitterByRiemannParaboloid.h index 90bcb71786c76..f9a0f12ecb500 100644 --- a/RecoPixelVertexing/PixelTrackFitting/interface/PixelFitterByRiemannParaboloid.h +++ b/RecoPixelVertexing/PixelTrackFitting/interface/PixelFitterByRiemannParaboloid.h @@ -1,24 +1,22 @@ #ifndef RecoPixelVertexing_PixelTrackFitting_PixelFitterByRiemannParaboloid_H #define RecoPixelVertexing_PixelTrackFitting_PixelFitterByRiemannParaboloid_H -#include "RecoPixelVertexing/PixelTrackFitting/interface/PixelFitterBase.h" +#include + +#include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" -#include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "DataFormats/TrackReco/interface/Track.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include - - +#include "RecoPixelVertexing/PixelTrackFitting/interface/PixelFitterBase.h" +#include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h" class PixelFitterByRiemannParaboloid final : public PixelFitterBase { public: explicit PixelFitterByRiemannParaboloid(const edm::EventSetup *es, const MagneticField *field, bool useErrors, bool useMultipleScattering); - virtual ~PixelFitterByRiemannParaboloid() = default; - virtual std::unique_ptr run(const std::vector& hits, - const TrackingRegion& region) const override; + ~PixelFitterByRiemannParaboloid() override = default; + std::unique_ptr run(const std::vector& hits, + const TrackingRegion& region) const override; private: const edm::EventSetup *es_; @@ -26,4 +24,5 @@ class PixelFitterByRiemannParaboloid final : public PixelFitterBase { bool useErrors_; bool useMultipleScattering_; }; -#endif + +#endif // RecoPixelVertexing_PixelTrackFitting_PixelFitterByRiemannParaboloid_H diff --git a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelFitterByRiemannParaboloidProducer.cc b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelFitterByRiemannParaboloidProducer.cc index bbd8c0fe46f95..1b471510774aa 100644 --- a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelFitterByRiemannParaboloidProducer.cc +++ b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelFitterByRiemannParaboloidProducer.cc @@ -24,7 +24,7 @@ class PixelFitterByRiemannParaboloidProducer: public edm::global::EDProducer<> { { produces(); } - ~PixelFitterByRiemannParaboloidProducer() {} + ~PixelFitterByRiemannParaboloidProducer() override {} static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; @@ -36,7 +36,7 @@ class PixelFitterByRiemannParaboloidProducer: public edm::global::EDProducer<> { private: bool useErrors_; bool useMultipleScattering_; - virtual void produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const override; + void produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const override; }; diff --git a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackReconstructionGPU.cc b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackReconstructionGPU.cc index 9c731ccf0d52b..68343253b670d 100644 --- a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackReconstructionGPU.cc +++ b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackReconstructionGPU.cc @@ -34,7 +34,7 @@ PixelTrackReconstructionGPU::PixelTrackReconstructionGPU(const ParameterSet& cfg theCleanerName(cfg.getParameter("Cleaner")) { edm::InputTag filterTag = cfg.getParameter("Filter"); - if(filterTag.label() != "") { + if(!filterTag.label().empty()) { theFilterToken = iC.consumes(filterTag); } } diff --git a/RecoPixelVertexing/PixelTrackFitting/test/PixelTrackRiemannFit.cc b/RecoPixelVertexing/PixelTrackFitting/test/PixelTrackRiemannFit.cc index b27ed52473388..77b5d1bebe6b6 100644 --- a/RecoPixelVertexing/PixelTrackFitting/test/PixelTrackRiemannFit.cc +++ b/RecoPixelVertexing/PixelTrackFitting/test/PixelTrackRiemannFit.cc @@ -190,7 +190,7 @@ void test_helix_fit() { gen_par(4) = 10.; // R (p_t) gen_par(5) = 1.; // eta iteration = 1; - return_err = 1; + return_err = true; debug2 = 1; iteration *= 10; diff --git a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletHeterogeneousEDProducer.cc b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletHeterogeneousEDProducer.cc index 47417690d54b4..fa86cf42688bc 100644 --- a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletHeterogeneousEDProducer.cc +++ b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletHeterogeneousEDProducer.cc @@ -37,7 +37,7 @@ class CAHitNtupletHeterogeneousEDProducer CAHitNtupletHeterogeneousEDProducer(const edm::ParameterSet &iConfig); - ~CAHitNtupletHeterogeneousEDProducer() = default; + ~CAHitNtupletHeterogeneousEDProducer() override = default; static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); void beginStreamGPUCuda(edm::StreamID streamId, diff --git a/RecoPixelVertexing/PixelVertexFinding/src/PixelVertexHeterogeneousConverter.cc b/RecoPixelVertexing/PixelVertexFinding/src/PixelVertexHeterogeneousConverter.cc index 890c34ab1f0b4..e6a78e1c438a9 100644 --- a/RecoPixelVertexing/PixelVertexFinding/src/PixelVertexHeterogeneousConverter.cc +++ b/RecoPixelVertexing/PixelVertexFinding/src/PixelVertexHeterogeneousConverter.cc @@ -12,7 +12,7 @@ class PixelVertexHeterogeneousConverter: public edm::global::EDProducer<> { public: explicit PixelVertexHeterogeneousConverter(edm::ParameterSet const& iConfig); - ~PixelVertexHeterogeneousConverter() = default; + ~PixelVertexHeterogeneousConverter() override = default; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); diff --git a/SimTracker/TrackerHitAssociation/plugins/ClusterTPAssociationHeterogeneous.cc b/SimTracker/TrackerHitAssociation/plugins/ClusterTPAssociationHeterogeneous.cc index 75417c56a1582..8690d78aace86 100644 --- a/SimTracker/TrackerHitAssociation/plugins/ClusterTPAssociationHeterogeneous.cc +++ b/SimTracker/TrackerHitAssociation/plugins/ClusterTPAssociationHeterogeneous.cc @@ -56,7 +56,7 @@ class ClusterTPAssociationHeterogeneous : public HeterogeneousEDProducer