Skip to content

Commit

Permalink
Rename temporary device collections to be more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
jsamudio committed Oct 30, 2023
1 parent 1e6a16d commit a83a686
Show file tree
Hide file tree
Showing 7 changed files with 282 additions and 290 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#ifndef RecoParticleFlow_PFRecHitProducerAlpaka_interface_tmpEdgeSoA_h
#define RecoParticleFlow_PFRecHitProducerAlpaka_interface_tmpEdgeSoA_h
#ifndef RecoParticleFlow_PFRecHitProducerAlpaka_interface_ClusteringEdgeVarsSoA_h
#define RecoParticleFlow_PFRecHitProducerAlpaka_interface_ClusteringEdgeVarsSoA_h

#include "DataFormats/SoATemplate/interface/SoACommon.h"
#include "DataFormats/SoATemplate/interface/SoALayout.h"
#include "DataFormats/SoATemplate/interface/SoAView.h"

namespace reco {

GENERATE_SOA_LAYOUT(tmpEdgeSoALayout,
GENERATE_SOA_LAYOUT(ClusteringEdgeVarsSoALayout,
SOA_COLUMN(int, pfrh_edgeIdx), // needs nRH + 1 allocation
SOA_COLUMN(int, pfrh_edgeList)) // needs nRH + maxNeighbors allocation

using tmpEdgeSoA = tmpEdgeSoALayout<>;
using ClusteringEdgeVarsSoA = ClusteringEdgeVarsSoALayout<>;
} // namespace reco

#endif
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#ifndef RecoParticleFlow_PFClusterProducerAlpaka_interface_tmpSoA_h
#define RecoParticleFlow_PFClusterProducerAlpaka_interface_tmpSoA_h
#ifndef RecoParticleFlow_PFClusterProducerAlpaka_interface_ClusteringVarsSoA_h
#define RecoParticleFlow_PFClusterProducerAlpaka_interface_ClusteringVarsSoA_h

#include "DataFormats/SoATemplate/interface/SoACommon.h"
#include "DataFormats/SoATemplate/interface/SoALayout.h"
#include "DataFormats/SoATemplate/interface/SoAView.h"

namespace reco {

GENERATE_SOA_LAYOUT(tmpSoALayout,
GENERATE_SOA_LAYOUT(ClusteringVarsSoALayout,
SOA_COLUMN(int, pfrh_topoId),
SOA_COLUMN(int, pfrh_isSeed),
SOA_COLUMN(int, pfrh_passTopoThresh),
Expand Down Expand Up @@ -37,7 +37,7 @@ namespace reco {
SOA_COLUMN(bool, processedTopo),
SOA_COLUMN(float, pcrh_fracSum))

using tmpSoA = tmpSoALayout<>;
using ClusteringVarsSoA = ClusteringVarsSoALayout<>;
} // namespace reco

#endif
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#ifndef RecoParticleFlow_PFRecHitProducerAlpaka_interface_alpaka_tmpEdgeDevice_h
#define RecoParticleFlow_PFRecHitProducerAlpaka_interface_alpaka_tmpEdgeDevice_h
#ifndef RecoParticleFlow_PFRecHitProducerAlpaka_interface_alpaka_ClusteringEdgeVarsDevice_h
#define RecoParticleFlow_PFRecHitProducerAlpaka_interface_alpaka_ClusteringEdgeVarsDevice_h

#include "DataFormats/Portable/interface/alpaka/PortableCollection.h"
#include "HeterogeneousCore/AlpakaInterface/interface/config.h"
#include "HeterogeneousCore/AlpakaInterface/interface/memory.h"

#include "RecoParticleFlow/PFClusterProducerAlpaka/interface/tmpEdgeSoA.h"
#include "RecoParticleFlow/PFClusterProducerAlpaka/interface/ClusteringEdgeVarsSoA.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE::reco {

using tmpEdgeDeviceCollection = PortableCollection<::reco::tmpEdgeSoA>;
using ClusteringEdgeVarsDeviceCollection = PortableCollection<::reco::ClusteringEdgeVarsSoA>;

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#ifndef RecoParticleFlow_PFRecHitProducerAlpaka_interface_alpaka_tmpDevice_h
#define RecoParticleFlow_PFRecHitProducerAlpaka_interface_alpaka_tmpDevice_h
#ifndef RecoParticleFlow_PFRecHitProducerAlpaka_interface_alpaka_ClusteringVarsDevice_h
#define RecoParticleFlow_PFRecHitProducerAlpaka_interface_alpaka_ClusteringVarsDevice_h

#include "DataFormats/Portable/interface/alpaka/PortableCollection.h"
#include "HeterogeneousCore/AlpakaInterface/interface/config.h"
#include "HeterogeneousCore/AlpakaInterface/interface/memory.h"

#include "RecoParticleFlow/PFClusterProducerAlpaka/interface/tmpSoA.h"
#include "RecoParticleFlow/PFClusterProducerAlpaka/interface/ClusteringVarsSoA.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE::reco {

using tmpDeviceCollection = PortableCollection<::reco::tmpSoA>;
using ClusteringVarsDeviceCollection = PortableCollection<::reco::ClusteringVarsSoA>;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
const reco::PFRecHitHostCollection& pfRecHits = event.get(InputPFRecHitSoA_Token_);
const int nRH = pfRecHits->size();

reco::tmpDeviceCollection tmp{nRH + 1, event.queue()};
reco::tmpEdgeDeviceCollection tmpEdge{(nRH * 8) + 1, event.queue()};
reco::ClusteringVarsDeviceCollection clusteringVars{nRH + 1, event.queue()};
reco::ClusteringEdgeVarsDeviceCollection clusteringEdgeVars{(nRH * 8) + 1, event.queue()};
reco::PFClusterDeviceCollection pfClusters{nRH, event.queue()};
reco::PFRecHitFractionDeviceCollection pfrhFractions{nRH * 120, event.queue()};

if (!kernel)
kernel.emplace(PFClusterProducerKernel::Construct(event.queue(), pfRecHits));
kernel->execute(event.device(), event.queue(), params, tmp, tmpEdge, pfRecHits, pfClusters, pfrhFractions);
kernel->execute(event.device(), event.queue(), params, clusteringVars, clusteringEdgeVars, pfRecHits, pfClusters, pfrhFractions);

if (synchronise)
alpaka::wait(event.queue());
Expand Down
Loading

0 comments on commit a83a686

Please sign in to comment.