From 7f2128537b047c46ca1e819403c9a46c5a552da7 Mon Sep 17 00:00:00 2001 From: jsamudio Date: Thu, 8 Aug 2024 08:29:15 -0500 Subject: [PATCH 1/3] Add dynamic allocation of the PFRecHitFraction SoA Fixed to work with latest updates Fix for case with 0 nRH Fix bad allocation crash Remove extra lines Simplify memcpy to single int Code checks and formatting Implement review suggestions --- .../plugins/alpaka/PFClusterSoAProducer.cc | 70 +++++++++++++------ .../alpaka/PFClusterSoAProducerKernel.dev.cc | 36 ++++++---- .../alpaka/PFClusterSoAProducerKernel.h | 26 ++++--- 3 files changed, 91 insertions(+), 41 deletions(-) diff --git a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducer.cc index 6017f539364ec..c2f3cbf920da3 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducer.cc @@ -8,7 +8,7 @@ #include "FWCore/Utilities/interface/EDGetToken.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Utilities/interface/StreamID.h" -#include "HeterogeneousCore/AlpakaCore/interface/alpaka/stream/EDProducer.h" +#include "HeterogeneousCore/AlpakaCore/interface/alpaka/stream/SynchronizingEDProducer.h" #include "HeterogeneousCore/CUDACore/interface/JobConfigurationGPURecord.h" #include "RecoParticleFlow/PFClusterProducer/interface/PFCPositionCalculatorBase.h" #include "RecoParticleFlow/PFClusterProducer/interface/alpaka/PFClusterParamsDeviceCollection.h" @@ -16,7 +16,7 @@ #include "RecoParticleFlow/PFRecHitProducer/interface/PFRecHitTopologyRecord.h" namespace ALPAKA_ACCELERATOR_NAMESPACE { - class PFClusterSoAProducer : public stream::EDProducer<> { + class PFClusterSoAProducer : public stream::SynchronizingEDProducer<> { public: PFClusterSoAProducer(edm::ParameterSet const& config) : pfClusParamsToken(esConsumes(config.getParameter("pfClusterParams"))), @@ -24,10 +24,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { inputPFRecHitSoA_Token_{consumes(config.getParameter("pfRecHits"))}, outputPFClusterSoA_Token_{produces()}, outputPFRHFractionSoA_Token_{produces()}, - synchronise_(config.getParameter("synchronise")), - pfRecHitFractionAllocation_(config.getParameter("pfRecHitFractionAllocation")) {} + num_rhf_{cms::alpakatools::make_host_buffer()}, + synchronise_(config.getParameter("synchronise")) {} - void produce(device::Event& event, device::EventSetup const& setup) override { + void acquire(device::Event const& event, device::EventSetup const& setup) override { const reco::PFClusterParamsDeviceCollection& params = setup.getData(pfClusParamsToken); const reco::PFRecHitHCALTopologyDeviceCollection& topology = setup.getData(topologyToken_); const reco::PFRecHitHostCollection& pfRecHits = event.get(inputPFRecHitSoA_Token_); @@ -35,28 +35,53 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { if (pfRecHits->metadata().size() != 0) nRH = pfRecHits->size(); - reco::PFClusteringVarsDeviceCollection pfClusteringVars{nRH, event.queue()}; - reco::PFClusteringEdgeVarsDeviceCollection pfClusteringEdgeVars{(nRH * 8), event.queue()}; - reco::PFClusterDeviceCollection pfClusters{nRH, event.queue()}; - reco::PFRecHitFractionDeviceCollection pfrhFractions{nRH * pfRecHitFractionAllocation_, event.queue()}; + pfClusteringVars_ = std::make_optional(nRH, event.queue()); + pfClusteringEdgeVars_ = std::make_optional(nRH * 8, event.queue()); + pfClusters_ = std::make_optional(nRH, event.queue()); + + *num_rhf_ = 0; + + if (nRH != 0) { + PFClusterProducerKernel kernel(event.queue(), pfRecHits); + kernel.step1(event.queue(), + params, + topology, + *pfClusteringVars_, + *pfClusteringEdgeVars_, + pfRecHits, + *pfClusters_, + num_rhf_.data()); + } + } + + void produce(device::Event& event, device::EventSetup const& setup) override { + const reco::PFClusterParamsDeviceCollection& params = setup.getData(pfClusParamsToken); + const reco::PFRecHitHCALTopologyDeviceCollection& topology = setup.getData(topologyToken_); + const reco::PFRecHitHostCollection& pfRecHits = event.get(inputPFRecHitSoA_Token_); + int nRH = 0; + if (pfRecHits->metadata().size() != 0) + nRH = pfRecHits->size(); if (nRH != 0) { + pfrhFractions_ = std::make_optional(*num_rhf_.data(), event.queue()); PFClusterProducerKernel kernel(event.queue(), pfRecHits); - kernel.execute(event.queue(), - params, - topology, - pfClusteringVars, - pfClusteringEdgeVars, - pfRecHits, - pfClusters, - pfrhFractions); + kernel.step2(event.queue(), + params, + topology, + *pfClusteringVars_, + *pfClusteringEdgeVars_, + pfRecHits, + *pfClusters_, + *pfrhFractions_); + } else { + pfrhFractions_ = std::make_optional(0, event.queue()); } if (synchronise_) alpaka::wait(event.queue()); - event.emplace(outputPFClusterSoA_Token_, std::move(pfClusters)); - event.emplace(outputPFRHFractionSoA_Token_, std::move(pfrhFractions)); + event.emplace(outputPFClusterSoA_Token_, std::move(*pfClusters_)); + event.emplace(outputPFRHFractionSoA_Token_, std::move(*pfrhFractions_)); } static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -65,7 +90,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { desc.add("pfClusterParams", edm::ESInputTag("")); desc.add("topology", edm::ESInputTag("")); desc.add("synchronise", false); - desc.add("pfRecHitFractionAllocation", 120); descriptions.addWithDefaultLabel(desc); } @@ -75,8 +99,12 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const edm::EDGetTokenT inputPFRecHitSoA_Token_; const device::EDPutToken outputPFClusterSoA_Token_; const device::EDPutToken outputPFRHFractionSoA_Token_; + cms::alpakatools::host_buffer num_rhf_; + std::optional pfClusteringVars_; + std::optional pfClusteringEdgeVars_; + std::optional pfClusters_; + std::optional pfrhFractions_; const bool synchronise_; - const int pfRecHitFractionAllocation_; }; } // namespace ALPAKA_ACCELERATOR_NAMESPACE diff --git a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.dev.cc b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.dev.cc index e54764190490b..de3351f9e70e1 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.dev.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.dev.cc @@ -1090,7 +1090,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const reco::PFRecHitHCALTopologyDeviceCollection::ConstView topology, const reco::PFRecHitHostCollection::ConstView pfRecHits, reco::PFClusterDeviceCollection::View clusterView, - reco::PFRecHitFractionDeviceCollection::View fracView, uint32_t* __restrict__ nSeeds) const { const int nRH = pfRecHits.size(); @@ -1199,7 +1198,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const reco::PFRecHitHostCollection::ConstView pfRecHits, reco::PFClusteringVarsDeviceCollection::View pfClusteringVars, reco::PFClusterDeviceCollection::View clusterView, - uint32_t* __restrict__ nSeeds) const { + uint32_t* __restrict__ nSeeds, + uint32_t* __restrict__ num_rhf_) const { const int nRH = pfRecHits.size(); int& totalSeedOffset = alpaka::declareSharedVar(acc); int& totalSeedFracOffset = alpaka::declareSharedVar(acc); @@ -1302,6 +1302,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { pfClusteringVars.pcrhFracSize() = totalSeedFracOffset; pfClusteringVars.nRHFracs() = totalSeedFracOffset; clusterView.nRHFracs() = totalSeedFracOffset; + *num_rhf_ = totalSeedFracOffset; clusterView.nSeeds() = *nSeeds; clusterView.nTopos() = pfClusteringVars.nTopos(); @@ -1467,14 +1468,14 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { alpaka::memset(queue, nSeeds, 0x00); // Reset nSeeds } - void PFClusterProducerKernel::execute(Queue& queue, - const reco::PFClusterParamsDeviceCollection& params, - const reco::PFRecHitHCALTopologyDeviceCollection& topology, - reco::PFClusteringVarsDeviceCollection& pfClusteringVars, - reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, - const reco::PFRecHitHostCollection& pfRecHits, - reco::PFClusterDeviceCollection& pfClusters, - reco::PFRecHitFractionDeviceCollection& pfrhFractions) { + void PFClusterProducerKernel::step1(Queue& queue, + const reco::PFClusterParamsDeviceCollection& params, + const reco::PFRecHitHCALTopologyDeviceCollection& topology, + reco::PFClusteringVarsDeviceCollection& pfClusteringVars, + reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, + const reco::PFRecHitHostCollection& pfRecHits, + reco::PFClusterDeviceCollection& pfClusters, + uint32_t* __restrict__ num_rhf_) { const int nRH = pfRecHits->size(); const int threadsPerBlock = 256; const int blocks = divide_up_by(nRH, threadsPerBlock); @@ -1488,7 +1489,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { topology.view(), pfRecHits.view(), pfClusters.view(), - pfrhFractions.view(), nSeeds.data()); // prepareTopoInputs alpaka::exec(queue, @@ -1524,7 +1524,19 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { pfRecHits.view(), pfClusteringVars.view(), pfClusters.view(), - nSeeds.data()); + nSeeds.data(), + num_rhf_); + } + + void PFClusterProducerKernel::step2(Queue& queue, + const reco::PFClusterParamsDeviceCollection& params, + const reco::PFRecHitHCALTopologyDeviceCollection& topology, + reco::PFClusteringVarsDeviceCollection& pfClusteringVars, + reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, + const reco::PFRecHitHostCollection& pfRecHits, + reco::PFClusterDeviceCollection& pfClusters, + reco::PFRecHitFractionDeviceCollection& pfrhFractions) { + const int nRH = pfRecHits->size(); // fillRhfIndex alpaka::exec(queue, diff --git a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.h b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.h index ed9541b1b9af4..50b37d42833e2 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.h +++ b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.h @@ -4,6 +4,7 @@ #include "DataFormats/ParticleFlowReco/interface/alpaka/PFRecHitDeviceCollection.h" #include "DataFormats/ParticleFlowReco/interface/PFRecHitHostCollection.h" #include "DataFormats/ParticleFlowReco/interface/alpaka/PFClusterDeviceCollection.h" +#include "DataFormats/ParticleFlowReco/interface/PFClusterHostCollection.h" #include "DataFormats/ParticleFlowReco/interface/alpaka/PFRecHitFractionDeviceCollection.h" #include "RecoParticleFlow/PFClusterProducer/interface/alpaka/PFClusterParamsDeviceCollection.h" #include "RecoParticleFlow/PFClusterProducer/interface/alpaka/PFClusteringVarsDeviceCollection.h" @@ -39,14 +40,23 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { public: PFClusterProducerKernel(Queue& queue, const reco::PFRecHitHostCollection& pfRecHits); - void execute(Queue& queue, - const reco::PFClusterParamsDeviceCollection& params, - const reco::PFRecHitHCALTopologyDeviceCollection& topology, - reco::PFClusteringVarsDeviceCollection& pfClusteringVars, - reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, - const reco::PFRecHitHostCollection& pfRecHits, - reco::PFClusterDeviceCollection& pfClusters, - reco::PFRecHitFractionDeviceCollection& pfrhFractions); + void step1(Queue& queue, + const reco::PFClusterParamsDeviceCollection& params, + const reco::PFRecHitHCALTopologyDeviceCollection& topology, + reco::PFClusteringVarsDeviceCollection& pfClusteringVars, + reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, + const reco::PFRecHitHostCollection& pfRecHits, + reco::PFClusterDeviceCollection& pfClusters, + uint32_t* __restrict__ num_rhf_); + + void step2(Queue& queue, + const reco::PFClusterParamsDeviceCollection& params, + const reco::PFRecHitHCALTopologyDeviceCollection& topology, + reco::PFClusteringVarsDeviceCollection& pfClusteringVars, + reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, + const reco::PFRecHitHostCollection& pfRecHits, + reco::PFClusterDeviceCollection& pfClusters, + reco::PFRecHitFractionDeviceCollection& pfrhFractions); private: cms::alpakatools::device_buffer nSeeds; From 231b4f07724732279bcfa4277191a76d4c98206e Mon Sep 17 00:00:00 2001 From: jsamudio Date: Tue, 1 Oct 2024 13:04:54 -0500 Subject: [PATCH 2/3] Update HLT customization for removed PFClusterSoAProducer parameter --- .../Configuration/python/customizeHLTforCMSSW.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index 3521bb7f82207..5079e01e22539 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -48,6 +48,16 @@ def customiseForOffline(process): return process +def customizeHLTfor46135(process): + """Remove pfRecHitFractionAllocation from PFClusterSoAProducer config""" + for producer in producers_by_type(process, "PFClusterSoAProducer@alpaka"): + if hasattr(producer, 'pfRecHitFractionAllocation'): + delattr(producer, 'pfRecHitFractionAllocation') + for producer in producers_by_type(process, "alpaka_serial_sync::PFClusterSoAProducer"): + if hasattr(producer, 'pfRecHitFractionAllocation'): + delattr(producer, 'pfRecHitFractionAllocation') + return process + # CMSSW version specific customizations def customizeHLTforCMSSW(process, menuType="GRun"): @@ -56,4 +66,6 @@ def customizeHLTforCMSSW(process, menuType="GRun"): # add call to action function in proper order: newest last! # process = customiseFor12718(process) + process = customizeHLTfor46135(process) + return process From cdedfc6b7afa9848de94db3b94295e21df17bd5f Mon Sep 17 00:00:00 2001 From: jsamudio Date: Wed, 2 Oct 2024 10:21:47 -0500 Subject: [PATCH 3/3] Rename variables and adjust allocation syntax Adjust formatting Rename data member and remove unnecessary include --- .../plugins/alpaka/PFClusterSoAProducer.cc | 54 ++++++++++--------- .../alpaka/PFClusterSoAProducerKernel.dev.cc | 38 ++++++------- .../alpaka/PFClusterSoAProducerKernel.h | 33 ++++++------ 3 files changed, 63 insertions(+), 62 deletions(-) diff --git a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducer.cc index c2f3cbf920da3..65c0e4f5c33f3 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducer.cc @@ -24,7 +24,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { inputPFRecHitSoA_Token_{consumes(config.getParameter("pfRecHits"))}, outputPFClusterSoA_Token_{produces()}, outputPFRHFractionSoA_Token_{produces()}, - num_rhf_{cms::alpakatools::make_host_buffer()}, + numRHF_{cms::alpakatools::make_host_buffer()}, synchronise_(config.getParameter("synchronise")) {} void acquire(device::Event const& event, device::EventSetup const& setup) override { @@ -35,22 +35,22 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { if (pfRecHits->metadata().size() != 0) nRH = pfRecHits->size(); - pfClusteringVars_ = std::make_optional(nRH, event.queue()); - pfClusteringEdgeVars_ = std::make_optional(nRH * 8, event.queue()); - pfClusters_ = std::make_optional(nRH, event.queue()); + pfClusteringVars_.emplace(nRH, event.queue()); + pfClusteringEdgeVars_.emplace(nRH * 8, event.queue()); + pfClusters_.emplace(nRH, event.queue()); - *num_rhf_ = 0; + *numRHF_ = 0; if (nRH != 0) { PFClusterProducerKernel kernel(event.queue(), pfRecHits); - kernel.step1(event.queue(), - params, - topology, - *pfClusteringVars_, - *pfClusteringEdgeVars_, - pfRecHits, - *pfClusters_, - num_rhf_.data()); + kernel.seedTopoAndContract(event.queue(), + params, + topology, + *pfClusteringVars_, + *pfClusteringEdgeVars_, + pfRecHits, + *pfClusters_, + numRHF_.data()); } } @@ -59,29 +59,32 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const reco::PFRecHitHCALTopologyDeviceCollection& topology = setup.getData(topologyToken_); const reco::PFRecHitHostCollection& pfRecHits = event.get(inputPFRecHitSoA_Token_); int nRH = 0; + + std::optional pfrhFractions; + if (pfRecHits->metadata().size() != 0) nRH = pfRecHits->size(); if (nRH != 0) { - pfrhFractions_ = std::make_optional(*num_rhf_.data(), event.queue()); + pfrhFractions.emplace(*numRHF_.data(), event.queue()); PFClusterProducerKernel kernel(event.queue(), pfRecHits); - kernel.step2(event.queue(), - params, - topology, - *pfClusteringVars_, - *pfClusteringEdgeVars_, - pfRecHits, - *pfClusters_, - *pfrhFractions_); + kernel.cluster(event.queue(), + params, + topology, + *pfClusteringVars_, + *pfClusteringEdgeVars_, + pfRecHits, + *pfClusters_, + *pfrhFractions); } else { - pfrhFractions_ = std::make_optional(0, event.queue()); + pfrhFractions.emplace(0, event.queue()); } if (synchronise_) alpaka::wait(event.queue()); event.emplace(outputPFClusterSoA_Token_, std::move(*pfClusters_)); - event.emplace(outputPFRHFractionSoA_Token_, std::move(*pfrhFractions_)); + event.emplace(outputPFRHFractionSoA_Token_, std::move(*pfrhFractions)); } static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -99,11 +102,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const edm::EDGetTokenT inputPFRecHitSoA_Token_; const device::EDPutToken outputPFClusterSoA_Token_; const device::EDPutToken outputPFRHFractionSoA_Token_; - cms::alpakatools::host_buffer num_rhf_; + cms::alpakatools::host_buffer numRHF_; std::optional pfClusteringVars_; std::optional pfClusteringEdgeVars_; std::optional pfClusters_; - std::optional pfrhFractions_; const bool synchronise_; }; diff --git a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.dev.cc b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.dev.cc index de3351f9e70e1..e0c5e8d5a24fa 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.dev.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.dev.cc @@ -1199,7 +1199,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { reco::PFClusteringVarsDeviceCollection::View pfClusteringVars, reco::PFClusterDeviceCollection::View clusterView, uint32_t* __restrict__ nSeeds, - uint32_t* __restrict__ num_rhf_) const { + uint32_t* __restrict__ nRHF) const { const int nRH = pfRecHits.size(); int& totalSeedOffset = alpaka::declareSharedVar(acc); int& totalSeedFracOffset = alpaka::declareSharedVar(acc); @@ -1302,7 +1302,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { pfClusteringVars.pcrhFracSize() = totalSeedFracOffset; pfClusteringVars.nRHFracs() = totalSeedFracOffset; clusterView.nRHFracs() = totalSeedFracOffset; - *num_rhf_ = totalSeedFracOffset; + *nRHF = totalSeedFracOffset; clusterView.nSeeds() = *nSeeds; clusterView.nTopos() = pfClusteringVars.nTopos(); @@ -1468,14 +1468,14 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { alpaka::memset(queue, nSeeds, 0x00); // Reset nSeeds } - void PFClusterProducerKernel::step1(Queue& queue, - const reco::PFClusterParamsDeviceCollection& params, - const reco::PFRecHitHCALTopologyDeviceCollection& topology, - reco::PFClusteringVarsDeviceCollection& pfClusteringVars, - reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, - const reco::PFRecHitHostCollection& pfRecHits, - reco::PFClusterDeviceCollection& pfClusters, - uint32_t* __restrict__ num_rhf_) { + void PFClusterProducerKernel::seedTopoAndContract(Queue& queue, + const reco::PFClusterParamsDeviceCollection& params, + const reco::PFRecHitHCALTopologyDeviceCollection& topology, + reco::PFClusteringVarsDeviceCollection& pfClusteringVars, + reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, + const reco::PFRecHitHostCollection& pfRecHits, + reco::PFClusterDeviceCollection& pfClusters, + uint32_t* __restrict__ nRHF) { const int nRH = pfRecHits->size(); const int threadsPerBlock = 256; const int blocks = divide_up_by(nRH, threadsPerBlock); @@ -1525,17 +1525,17 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { pfClusteringVars.view(), pfClusters.view(), nSeeds.data(), - num_rhf_); + nRHF); } - void PFClusterProducerKernel::step2(Queue& queue, - const reco::PFClusterParamsDeviceCollection& params, - const reco::PFRecHitHCALTopologyDeviceCollection& topology, - reco::PFClusteringVarsDeviceCollection& pfClusteringVars, - reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, - const reco::PFRecHitHostCollection& pfRecHits, - reco::PFClusterDeviceCollection& pfClusters, - reco::PFRecHitFractionDeviceCollection& pfrhFractions) { + void PFClusterProducerKernel::cluster(Queue& queue, + const reco::PFClusterParamsDeviceCollection& params, + const reco::PFRecHitHCALTopologyDeviceCollection& topology, + reco::PFClusteringVarsDeviceCollection& pfClusteringVars, + reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, + const reco::PFRecHitHostCollection& pfRecHits, + reco::PFClusterDeviceCollection& pfClusters, + reco::PFRecHitFractionDeviceCollection& pfrhFractions) { const int nRH = pfRecHits->size(); // fillRhfIndex diff --git a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.h b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.h index 50b37d42833e2..32c68a64f4b24 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.h +++ b/RecoParticleFlow/PFClusterProducer/plugins/alpaka/PFClusterSoAProducerKernel.h @@ -4,7 +4,6 @@ #include "DataFormats/ParticleFlowReco/interface/alpaka/PFRecHitDeviceCollection.h" #include "DataFormats/ParticleFlowReco/interface/PFRecHitHostCollection.h" #include "DataFormats/ParticleFlowReco/interface/alpaka/PFClusterDeviceCollection.h" -#include "DataFormats/ParticleFlowReco/interface/PFClusterHostCollection.h" #include "DataFormats/ParticleFlowReco/interface/alpaka/PFRecHitFractionDeviceCollection.h" #include "RecoParticleFlow/PFClusterProducer/interface/alpaka/PFClusterParamsDeviceCollection.h" #include "RecoParticleFlow/PFClusterProducer/interface/alpaka/PFClusteringVarsDeviceCollection.h" @@ -40,23 +39,23 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { public: PFClusterProducerKernel(Queue& queue, const reco::PFRecHitHostCollection& pfRecHits); - void step1(Queue& queue, - const reco::PFClusterParamsDeviceCollection& params, - const reco::PFRecHitHCALTopologyDeviceCollection& topology, - reco::PFClusteringVarsDeviceCollection& pfClusteringVars, - reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, - const reco::PFRecHitHostCollection& pfRecHits, - reco::PFClusterDeviceCollection& pfClusters, - uint32_t* __restrict__ num_rhf_); + void seedTopoAndContract(Queue& queue, + const reco::PFClusterParamsDeviceCollection& params, + const reco::PFRecHitHCALTopologyDeviceCollection& topology, + reco::PFClusteringVarsDeviceCollection& pfClusteringVars, + reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, + const reco::PFRecHitHostCollection& pfRecHits, + reco::PFClusterDeviceCollection& pfClusters, + uint32_t* __restrict__ nRHF); - void step2(Queue& queue, - const reco::PFClusterParamsDeviceCollection& params, - const reco::PFRecHitHCALTopologyDeviceCollection& topology, - reco::PFClusteringVarsDeviceCollection& pfClusteringVars, - reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, - const reco::PFRecHitHostCollection& pfRecHits, - reco::PFClusterDeviceCollection& pfClusters, - reco::PFRecHitFractionDeviceCollection& pfrhFractions); + void cluster(Queue& queue, + const reco::PFClusterParamsDeviceCollection& params, + const reco::PFRecHitHCALTopologyDeviceCollection& topology, + reco::PFClusteringVarsDeviceCollection& pfClusteringVars, + reco::PFClusteringEdgeVarsDeviceCollection& pfClusteringEdgeVars, + const reco::PFRecHitHostCollection& pfRecHits, + reco::PFClusterDeviceCollection& pfClusters, + reco::PFRecHitFractionDeviceCollection& pfrhFractions); private: cms::alpakatools::device_buffer nSeeds;