Skip to content

Commit

Permalink
fix for max number of channels
Browse files Browse the repository at this point in the history
  • Loading branch information
amassiro committed Jun 11, 2020
1 parent 15702e1 commit 485e727
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
2 changes: 2 additions & 0 deletions RecoLocalCalo/EcalRecAlgos/interface/DeclsForKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ namespace ecal {
EcalSampleMask const& sampleMask;
EcalTimeOffsetConstant const& timeOffsetConstant;
uint32_t offsetForHashes;
uint32_t nchannels;
};

//*/
Expand Down Expand Up @@ -339,6 +340,7 @@ namespace ecal {
//
//
uint32_t offsetForHashes;
uint32_t nchannels;
};

} // namespace rechit
Expand Down
8 changes: 6 additions & 2 deletions RecoLocalCalo/EcalRecAlgos/src/EcalRecHitBuilderKernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,14 @@ namespace ecal {
ConditionsProducts const& conditions,
ConfigurationParameters const& configParameters,
uint32_t const nChannelsBarrel,
// uint32_t const nchannels,
edm::TimeValue_t const event_time,
cudaStream_t cudaStream) {
int nchannels = eventInputGPU.ebUncalibRecHits.size + eventInputGPU.eeUncalibRecHits.size;

// int nchannels = eventInputGPU.ebUncalibRecHits.size + eventInputGPU.eeUncalibRecHits.size;
int nchannels = conditions.nchannels;
//
// nChannelsBarrel and offsetForHashes should be the same? TEST
//
// unsigned int nchannels_per_block = 32;
unsigned int nchannels_per_block = 16;
unsigned int threads_min = nchannels_per_block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ namespace ecal {

uint32_t const offsetForHashes = conditions.offsetForHashes;
uint32_t const offsetForInputs = eventInputGPU.ebDigis.ndigis;
unsigned int totalChannels = eventInputGPU.ebDigis.ndigis + eventInputGPU.eeDigis.ndigis;

// unsigned int totalChannels = eventInputGPU.ebDigis.ndigis + eventInputGPU.eeDigis.ndigis;
unsigned int totalChannels = conditions.nchannels;

//
// 1d preparation kernel
//
Expand Down
15 changes: 12 additions & 3 deletions RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducerGPU.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,16 @@ void EcalRecHitProducerGPU::acquire(edm::Event const& event,

if ((neb_ + nee_) > maxNumberHits_) {
edm::LogError("EcalRecHitProducerGPU") << "max number of channels exceeded. See options 'maxNumberHits' ";
if (neb_ > maxNumberHits_) {
neb_ = maxNumberHits_;
nee_ = 0;
} else if ((neb_ + nee_) > maxNumberHits_) {
nee_ = maxNumberHits_ - neb_;
}
}

int nchannelsEB = ebUncalibRecHits.size; // --> offsetForInput, first EB and then EE
uint32_t nchannels = neb_ + nee_;
// int nchannelsEB = neb_; // --> offsetForInput, first EB and then EE

// conditions
// - laser correction
Expand Down Expand Up @@ -346,7 +353,9 @@ void EcalRecHitProducerGPU::acquire(edm::Event const& event,
LaserAlphasProduct,
LinearCorrectionsProduct,
//
IntercalibConstantsHandle_->getOffset()};
//IntercalibConstantsHandle_->getOffset(),
neb_,
nchannels};

//
// schedule algorithms
Expand All @@ -359,7 +368,7 @@ void EcalRecHitProducerGPU::acquire(edm::Event const& event,
// eventDataForScratchGPU_,
conditions,
configParameters_,
nchannelsEB,
neb_,
event_time,
ctx.stream());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,14 @@ void EcalUncalibRecHitProducerGPU::acquire(edm::Event const& event,

if ((neb_ + nee_) > maxNumberHits_) {
edm::LogError("EcalUncalibRecHitProducerGPU") << "max number of channels exceeded. See options 'maxNumberHits' ";
if (neb_ > maxNumberHits_) {
neb_ = maxNumberHits_;
nee_ = 0;
} else if ((neb_ + nee_) > maxNumberHits_) {
nee_ = maxNumberHits_ - neb_;
}
}
auto nchannels = neb_ + nee_;

// conditions
setup.get<EcalPedestalsRcd>().get(pedestalsHandle_);
Expand Down Expand Up @@ -320,7 +327,9 @@ void EcalUncalibRecHitProducerGPU::acquire(edm::Event const& event,
timeCalibConstantsProduct,
*sampleMaskHandle_,
*timeOffsetConstantHandle_,
timeCalibConstantsHandle_->getOffset()};
//timeCalibConstantsHandle_->getOffset(),
neb_,
nchannels};

//
// schedule algorithms
Expand Down

0 comments on commit 485e727

Please sign in to comment.