Skip to content

Commit

Permalink
Protect ECAL unpacker for events without EB
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Jun 26, 2024
1 parent 94a8581 commit d0f844f
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Acc1D>(blocksFixMGPA, threadsFixMGPA);
alpaka::exec<Acc1D>(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<Acc1D>(blocksFixMGPA, threadsFixMGPA);
alpaka::exec<Acc1D>(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;
Expand Down

0 comments on commit d0f844f

Please sign in to comment.