Skip to content

Commit

Permalink
Merge pull request cms-sw#10 from fllor/PFRecHitAndCluster_GPU_13_0_0…
Browse files Browse the repository at this point in the history
…_pre4_stable

Add CaloRecHitSoA and PFRecHitSoA and PFRecHitProducerAlpaka
  • Loading branch information
jsamudio authored Feb 23, 2023
2 parents ef3f687 + c24b26f commit 115ff23
Show file tree
Hide file tree
Showing 23 changed files with 874 additions and 120 deletions.
9 changes: 7 additions & 2 deletions DataFormats/ParticleFlowReco/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
<use name="FWCore/MessageLogger"/>
<use name="rootcore"/>
<use name="rootmath"/>
<flags LCG_DICT_HEADER="classes_1.h classes_2.h"/>
<flags LCG_DICT_XML="classes_def_1.xml classes_def_2.xml"/>
<use name="eigen"/>
<use name="DataFormats/Portable"/>
<use name="DataFormats/SoATemplate"/>
<use name="HeterogeneousCore/AlpakaInterface"/>
<flags ALPAKA_BACKENDS="1"/>
<export>
<lib name="1"/>
</export>


Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef ParticleFlowReco_CaloRecHitHostCollection_h
#define ParticleFlowReco_CaloRecHitHostCollection_h

#include "DataFormats/Portable/interface/PortableHostCollection.h"
#include "DataFormats/ParticleFlowReco/interface/CaloRecHitSoA.h"

using CaloRecHitHostCollection = PortableHostCollection<CaloRecHitSoA>;

#endif
17 changes: 17 additions & 0 deletions DataFormats/ParticleFlowReco/interface/CaloRecHitSoA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef ParticleFlowReco_CaloRecHitSoA_h
#define ParticleFlowReco_CaloRecHitSoA_h

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

GENERATE_SOA_LAYOUT(CaloRecHitSoALayout,
SOA_COLUMN(uint32_t, detId),
SOA_COLUMN(float, energy),
SOA_COLUMN(float, time)
)

using CaloRecHitSoA = CaloRecHitSoALayout<>;

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef ParticleFlowReco_PFRecHitHostCollection_h
#define ParticleFlowReco_PFRecHitHostCollection_h

#include "DataFormats/ParticleFlowReco/interface/PFRecHitSoA.h"
#include "DataFormats/Portable/interface/PortableHostCollection.h"

using PFRecHitHostCollection = PortableHostCollection<PFRecHitSoA>;

#endif
26 changes: 26 additions & 0 deletions DataFormats/ParticleFlowReco/interface/PFRecHitSoA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef ParticleFlowReco_PFRecHitSoA_h
#define ParticleFlowReco_PFRecHitSoA_h

#include <Eigen/Core>
#include <Eigen/Dense>

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

#include "DataFormats/ParticleFlowReco/interface/PFLayer.h"

using Vec8 = Eigen::Matrix<uint32_t, 8, 1>;
GENERATE_SOA_LAYOUT(PFRecHitSoALayout,
SOA_COLUMN(uint32_t, detId),
SOA_COLUMN(float, energy),
SOA_COLUMN(float, time),
SOA_COLUMN(int, depth),
SOA_COLUMN(PFLayer::Layer, layer),
SOA_EIGEN_COLUMN(Vec8, neighbours),
SOA_SCALAR(uint32_t, size)
)

using PFRecHitSoA = PFRecHitSoALayout<>;

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef ParticleFlowReco_CaloRecHitDeviceCollection_h
#define ParticleFlowReco_CaloRecHitDeviceCollection_h

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

namespace ALPAKA_ACCELERATOR_NAMESPACE {
using CaloRecHitDeviceCollection = PortableCollection<CaloRecHitSoA>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef ParticleFlowReco_PFRecHitDeviceCollection_h
#define ParticleFlowReco_PFRecHitDeviceCollection_h

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

namespace ALPAKA_ACCELERATOR_NAMESPACE {
using PFRecHitDeviceCollection = PortableCollection<PFRecHitSoA>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE

#endif
7 changes: 7 additions & 0 deletions DataFormats/ParticleFlowReco/src/alpaka/classes_cuda.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "DataFormats/Common/interface/DeviceProduct.h"
#include "DataFormats/Common/interface/Wrapper.h"
#include "DataFormats/Portable/interface/Product.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecHitSoA.h"
#include "DataFormats/ParticleFlowReco/interface/alpaka/PFRecHitDeviceCollection.h"
#include "DataFormats/ParticleFlowReco/interface/CaloRecHitSoA.h"
#include "DataFormats/ParticleFlowReco/interface/alpaka/CaloRecHitDeviceCollection.h"
9 changes: 9 additions & 0 deletions DataFormats/ParticleFlowReco/src/alpaka/classes_cuda_def.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<lcgdict>
<class name="alpaka_cuda_async::CaloRecHitDeviceCollection" persistent="false"/>
<class name="edm::DeviceProduct<alpaka_cuda_async::CaloRecHitDeviceCollection>" persistent="false"/>
<class name="edm::Wrapper<edm::DeviceProduct<alpaka_cuda_async::CaloRecHitDeviceCollection>>" persistent="false"/>

<class name="alpaka_cuda_async::PFRecHitDeviceCollection" persistent="false"/>
<class name="edm::DeviceProduct<alpaka_cuda_async::PFRecHitDeviceCollection>" persistent="false"/>
<class name="edm::Wrapper<edm::DeviceProduct<alpaka_cuda_async::PFRecHitDeviceCollection>>" persistent="false"/>
</lcgdict>
6 changes: 6 additions & 0 deletions DataFormats/ParticleFlowReco/src/alpaka/classes_serial.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "DataFormats/Common/interface/Wrapper.h"
#include "DataFormats/Portable/interface/Product.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecHitSoA.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecHitHostCollection.h"
#include "DataFormats/ParticleFlowReco/interface/CaloRecHitSoA.h"
#include "DataFormats/ParticleFlowReco/interface/CaloRecHitHostCollection.h"
29 changes: 29 additions & 0 deletions DataFormats/ParticleFlowReco/src/alpaka/classes_serial_def.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<lcgdict>
<class name="CaloRecHitHostCollection"/>
<read
sourceClass="CaloRecHitHostCollection"
targetClass="CaloRecHitHostCollection"
version="[1-]"
source="CaloRecHitSoA layout_;"
target="buffer_,layout_,view_"
embed="false">
<![CDATA[
CaloRecHitHostCollection::ROOTReadStreamer(newObj, onfile.layout_);
]]>
</read>
<class name="edm::Wrapper<CaloRecHitHostCollection>" splitLevel="0"/>

<class name="PFRecHitHostCollection"/>
<read
sourceClass="PFRecHitHostCollection"
targetClass="PFRecHitHostCollection"
version="[1-]"
source="PFRecHitSoA layout_;"
target="buffer_,layout_,view_"
embed="false">
<![CDATA[
PFRecHitHostCollection::ROOTReadStreamer(newObj, onfile.layout_);
]]>
</read>
<class name="edm::Wrapper<PFRecHitHostCollection>" splitLevel="0"/>
</lcgdict>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <DataFormats/Common/interface/ClonePolicy.h>
#include "DataFormats/Common/interface/ValueMap.h"

#include "DataFormats/ParticleFlowReco/interface/PFRecHitSoA.h"
#include "DataFormats/ParticleFlowReco/interface/CaloRecHitSoA.h"
#include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
#include "Math/Cartesian3D.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecHit.h"
Expand Down
54 changes: 0 additions & 54 deletions DataFormats/ParticleFlowReco/src/classes_1.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,68 @@
<lcgdict>
<selection>


<class name="reco::PFNuclearInteraction" ClassVersion="10">
<version ClassVersion="10" checksum="1573561360"/>
</class>
<class name="std::vector<reco::PFNuclearInteraction>" />
<class name="edm::Wrapper<std::vector<reco::PFNuclearInteraction> >" />
<class name="edm::Ref<std::vector<reco::PFNuclearInteraction>, reco::PFNuclearInteraction, edm::refhelper::FindUsingAdvance<std::vector<reco::PFNuclearInteraction>, reco::PFNuclearInteraction> >" />
<class name="edm::RefProd<std::vector<reco::PFNuclearInteraction> >" />
<class name="edm::RefVector<std::vector<reco::PFNuclearInteraction>, reco::PFNuclearInteraction, edm::refhelper::FindUsingAdvance<std::vector<reco::PFNuclearInteraction>, reco::PFNuclearInteraction> >" />


<class name="reco::PFDisplacedTrackerVertex" ClassVersion="10">
<version ClassVersion="10" checksum="2059737151"/>
</class>
<class name="std::vector<reco::PFDisplacedTrackerVertex>" />
<class name="edm::Wrapper<std::vector<reco::PFDisplacedTrackerVertex> >" />
<class name="edm::Ref<std::vector<reco::PFDisplacedTrackerVertex>, reco::PFDisplacedTrackerVertex, edm::refhelper::FindUsingAdvance<std::vector<reco::PFDisplacedTrackerVertex>, reco::PFDisplacedTrackerVertex> >" />
<class name="edm::RefProd<std::vector<reco::PFDisplacedTrackerVertex> >" />
<class name="edm::RefVector<std::vector<reco::PFDisplacedTrackerVertex>, reco::PFDisplacedTrackerVertex, edm::refhelper::FindUsingAdvance<std::vector<reco::PFDisplacedTrackerVertex>, reco::PFDisplacedTrackerVertex> >" />

<class name="reco::PFConversion" ClassVersion="10">
<version ClassVersion="10" checksum="2417207933"/>
</class>
<class name="std::vector<reco::PFConversion>"/>
<class name="edm::Wrapper<std::vector<reco::PFConversion> >"/>
<class name="edm::Ref<std::vector<reco::PFConversion>,reco::PFConversion,edm::refhelper::FindUsingAdvance<std::vector<reco::PFConversion>,reco::PFConversion> >"/>
<class name="edm::RefProd<std::vector<reco::PFConversion> >"/>
<class name="edm::RefVector<std::vector<reco::PFConversion>,reco::PFConversion,edm::refhelper::FindUsingAdvance<std::vector<reco::PFConversion>,reco::PFConversion> >"/>
<class name="std::vector<edm::Ref<std::vector<reco::PFRecTrack>,reco::PFRecTrack,edm::refhelper::FindUsingAdvance<std::vector<reco::PFRecTrack>,reco::PFRecTrack> > >"/>

<class name="reco::PFV0" ClassVersion="10">
<version ClassVersion="10" checksum="40832700"/>
</class>
<class name="std::vector<reco::PFV0>" />
<class name="edm::Wrapper<std::vector<reco::PFV0> >" />
<class name="edm::Ref<std::vector<reco::PFV0>, reco::PFV0, edm::refhelper::FindUsingAdvance<std::vector<reco::PFV0>, reco::PFV0> >" />
<class name="edm::RefProd<std::vector<reco::PFV0> >" />
<class name="edm::RefVector<std::vector<reco::PFV0>, reco::PFV0, edm::refhelper::FindUsingAdvance<std::vector<reco::PFV0>, reco::PFV0> >" />
<class name="edm::Ref<std::vector<reco::VertexCompositeCandidate>,reco::VertexCompositeCandidate,edm::refhelper::FindUsingAdvance<std::vector<reco::VertexCompositeCandidate>,reco::VertexCompositeCandidate> >" />


<class name="reco::ConvBremSeed" ClassVersion="12">
<version ClassVersion="10" checksum="2980747190"/>
<version ClassVersion="11" checksum="637662266"/>
<version ClassVersion="12" checksum="2604169839"/>
</class>
<class name="std::vector<reco::ConvBremSeed>"/>
<class name="edm::Ref<std::vector<reco::ConvBremSeed>,reco::ConvBremSeed,edm::refhelper::FindUsingAdvance<std::vector<reco::ConvBremSeed>,reco::ConvBremSeed> >"/>
<class name="edm::RefProd<std::vector<reco::ConvBremSeed> >"/>
<class name="edm::Wrapper<std::vector<reco::ConvBremSeed> >"/>
<class name="edm::RefVector<std::vector<reco::ConvBremSeed>,reco::ConvBremSeed,edm::refhelper::FindUsingAdvance<std::vector<reco::ConvBremSeed>,reco::ConvBremSeed> >"/>
<class name="edm::Wrapper<edm::RefVector<std::vector<reco::ConvBremSeed>,reco::ConvBremSeed,edm::refhelper::FindUsingAdvance<std::vector<reco::ConvBremSeed>,reco::ConvBremSeed> > >"/>
<class name="edm::RefToBase<reco::ConvBremSeed>"/>
<class name="edm::reftobase::BaseHolder<reco::ConvBremSeed>" />
<class name="edm::reftobase::RefHolder<edm::Ref<std::vector<reco::ConvBremSeed>,reco::ConvBremSeed,edm::refhelper::FindUsingAdvance<std::vector<reco::ConvBremSeed>,reco::ConvBremSeed> > >"/>
<class name="edm::reftobase::Holder<reco::ConvBremSeed,edm::Ref<std::vector<reco::ConvBremSeed>,reco::ConvBremSeed,edm::refhelper::FindUsingAdvance<std::vector<reco::ConvBremSeed>,reco::ConvBremSeed> > >"/>

<class name="CaloRecHitSoA"/>
<class name="CaloRecHitSoA::View"/>
<class name="PFRecHitSoA"/>
<class name="PFRecHitSoA::View"/>

<class name="reco::PFCluster" ClassVersion="17">
<version ClassVersion="17" checksum="3021111509"/>
<version ClassVersion="16" checksum="1786894710"/>
Expand Down
64 changes: 0 additions & 64 deletions DataFormats/ParticleFlowReco/src/classes_def_1.xml

This file was deleted.

7 changes: 7 additions & 0 deletions RecoParticleFlow/PFRecHitProducer/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<use name="FWCore/Framework"/>
<use name="HeterogeneousCore/AlpakaCore"/>
<use name="HeterogeneousCore/AlpakaInterface"/>
<flags ALPAKA_BACKENDS="1"/>
<export>
<lib name="1"/>
</export>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef RecoParticleFlow_PFRecHitProducer_PFRecHitProducerKernel_h
#define RecoParticleFlow_PFRecHitProducer_PFRecHitProducerKernel_h

#include "DataFormats/ParticleFlowReco/interface/alpaka/PFRecHitDeviceCollection.h"
#include "DataFormats/ParticleFlowReco/interface/alpaka/CaloRecHitDeviceCollection.h"
#include "HeterogeneousCore/AlpakaInterface/interface/config.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE {

class PFRecHitProducerKernel {
public:
void execute(Queue& queue, const CaloRecHitDeviceCollection& recHits, PFRecHitDeviceCollection& collection) const;
};

} // namespace ALPAKA_ACCELERATOR_NAMESPACE

#endif
Loading

0 comments on commit 115ff23

Please sign in to comment.