diff --git a/RecoLocalCalo/EcalRecProducers/plugins/alpaka/EcalUncalibRecHitMultiFitAlgoPortable.dev.cc b/RecoLocalCalo/EcalRecProducers/plugins/alpaka/EcalUncalibRecHitMultiFitAlgoPortable.dev.cc index e2f56ae901903..3d0b5576c90f7 100644 --- a/RecoLocalCalo/EcalRecProducers/plugins/alpaka/EcalUncalibRecHitMultiFitAlgoPortable.dev.cc +++ b/RecoLocalCalo/EcalRecProducers/plugins/alpaka/EcalUncalibRecHitMultiFitAlgoPortable.dev.cc @@ -118,20 +118,22 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::ecal::multifit { // TODO: small kernel only for EB. It needs to be checked if /// fusing such small kernels is beneficial in here // - // we are running only over EB digis - // therefore we need to create threads/blocks only for that - auto const threadsFixMGPA = threads_1d; - auto const blocksFixMGPA = cms::alpakatools::divide_up_by(kMaxSamples * ebSize, threadsFixMGPA); - auto workDivTimeFixMGPAslew1D = cms::alpakatools::make_workdiv(blocksFixMGPA, threadsFixMGPA); - alpaka::exec(queue, - workDivTimeFixMGPAslew1D, - Kernel_time_compute_fixMGPAslew{}, - digisDevEB.const_view(), - digisDevEE.const_view(), - conditionsDev.const_view(), - scratch.sample_valuesDevBuf.value().data(), - scratch.sample_value_errorsDevBuf.value().data(), - scratch.useless_sample_valuesDevBuf.value().data()); + if (ebSize > 0) { + // we are running only over EB digis + // therefore we need to create threads/blocks only for that + auto const threadsFixMGPA = threads_1d; + auto const blocksFixMGPA = cms::alpakatools::divide_up_by(kMaxSamples * ebSize, threadsFixMGPA); + auto workDivTimeFixMGPAslew1D = cms::alpakatools::make_workdiv(blocksFixMGPA, threadsFixMGPA); + alpaka::exec(queue, + workDivTimeFixMGPAslew1D, + Kernel_time_compute_fixMGPAslew{}, + digisDevEB.const_view(), + digisDevEE.const_view(), + conditionsDev.const_view(), + scratch.sample_valuesDevBuf.value().data(), + scratch.sample_value_errorsDevBuf.value().data(), + scratch.useless_sample_valuesDevBuf.value().data()); + } auto const threads_nullhypot = threads_1d; auto const blocks_nullhypot = blocks_1d;