From 24f4fb1bfa2bacbbef9b7722410a18fd9ef8d89b Mon Sep 17 00:00:00 2001 From: Cms Build Date: Thu, 11 Jun 2020 11:04:55 +0200 Subject: [PATCH] Fixes for ECAL rechits on GPU (cms-patatrack#475) EcalLinearCorrectionsGPU: - add missing cudaFree() EcalRecHitBuilderKernels: - fix warnings due to unused variables - fix incorrectly skipping some channels due to the use of "return" in the kernel loop - add default values for dead/invalid channels --- .../EcalRecAlgos/src/EcalLinearCorrectionsGPU.cc | 4 ++++ .../EcalRecProducers/plugins/EcalRecHitProducerGPU.cc | 8 +------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/RecoLocalCalo/EcalRecAlgos/src/EcalLinearCorrectionsGPU.cc b/RecoLocalCalo/EcalRecAlgos/src/EcalLinearCorrectionsGPU.cc index 20946028aba90..0af2a9044ab65 100644 --- a/RecoLocalCalo/EcalRecAlgos/src/EcalLinearCorrectionsGPU.cc +++ b/RecoLocalCalo/EcalRecAlgos/src/EcalLinearCorrectionsGPU.cc @@ -38,6 +38,10 @@ EcalLinearCorrectionsGPU::Product::~Product() { // deallocation cudaCheck(cudaFree(p1)); cudaCheck(cudaFree(p2)); + cudaCheck(cudaFree(p3)); + cudaCheck(cudaFree(t1)); + cudaCheck(cudaFree(t2)); + cudaCheck(cudaFree(t3)); } EcalLinearCorrectionsGPU::Product const& EcalLinearCorrectionsGPU::getProduct(cudaStream_t cudaStream) const { diff --git a/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducerGPU.cc b/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducerGPU.cc index 1c80d648f1eed..0a1260dffefd2 100644 --- a/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducerGPU.cc +++ b/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducerGPU.cc @@ -7,10 +7,6 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" -// -// -// - // format #include "CUDADataFormats/EcalRecHitSoA/interface/EcalUncalibratedRecHit_soa.h" #include "CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit_soa.h" @@ -302,7 +298,7 @@ void EcalRecHitProducerGPU::acquire(edm::Event const& event, neb_ = ebUncalibRecHits.size; nee_ = eeUncalibRecHits.size; - // std::cout << " [EcalRecHitProducerGPU::acquire] neb_:nee_ = " << neb_ << " : " << nee_ << std::endl; + // std::cout << " [EcalRecHitProducerGPU::acquire] neb_:nee_ = " << neb_ << " : " << nee_ << std::endl; int nchannelsEB = ebUncalibRecHits.size; // --> offsetForInput, first EB and then EE @@ -321,8 +317,6 @@ void EcalRecHitProducerGPU::acquire(edm::Event const& event, setup.get().get(LaserAlphasHandle_); setup.get().get(LinearCorrectionsHandle_); - // - auto const& ADCToGeVConstantProduct = ADCToGeVConstantHandle_->getProduct(ctx.stream()); auto const& IntercalibConstantsProduct = IntercalibConstantsHandle_->getProduct(ctx.stream()); auto const& ChannelStatusProduct = ChannelStatusHandle_->getProduct(ctx.stream());