Skip to content

Commit

Permalink
Moved MD SoA definition to its own header
Browse files Browse the repository at this point in the history
  • Loading branch information
ariostas committed Oct 10, 2024
1 parent 129a2d4 commit 66612e8
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 53 deletions.
61 changes: 61 additions & 0 deletions RecoTracker/LSTCore/interface/MiniDoubletsSoA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#ifndef RecoTracker_LSTCore_interface_MiniDoubletsSoA_h
#define RecoTracker_LSTCore_interface_MiniDoubletsSoA_h

#include "DataFormats/SoATemplate/interface/SoALayout.h"
#include "DataFormats/Portable/interface/alpaka/PortableCollection.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {

GENERATE_SOA_LAYOUT(MiniDoubletsSoALayout,
SOA_COLUMN(unsigned int, anchorHitIndices),
SOA_COLUMN(unsigned int, outerHitIndices),
SOA_COLUMN(uint16_t, moduleIndices),
SOA_COLUMN(float, dphichanges),
SOA_COLUMN(float, dzs),
SOA_COLUMN(float, dphis),
SOA_COLUMN(float, shiftedXs),
SOA_COLUMN(float, shiftedYs),
SOA_COLUMN(float, shiftedZs),
SOA_COLUMN(float, noShiftedDphis),
SOA_COLUMN(float, noShiftedDphiChanges),
SOA_COLUMN(float, anchorX),
SOA_COLUMN(float, anchorY),
SOA_COLUMN(float, anchorZ),
SOA_COLUMN(float, anchorRt),
SOA_COLUMN(float, anchorPhi),
SOA_COLUMN(float, anchorEta),
SOA_COLUMN(float, anchorHighEdgeX),
SOA_COLUMN(float, anchorHighEdgeY),
SOA_COLUMN(float, anchorLowEdgeX),
SOA_COLUMN(float, anchorLowEdgeY),
SOA_COLUMN(float, anchorLowEdgePhi),
SOA_COLUMN(float, anchorHighEdgePhi),
SOA_COLUMN(float, outerX),
SOA_COLUMN(float, outerY),
SOA_COLUMN(float, outerZ),
SOA_COLUMN(float, outerRt),
SOA_COLUMN(float, outerPhi),
SOA_COLUMN(float, outerEta),
SOA_COLUMN(float, outerHighEdgeX),
SOA_COLUMN(float, outerHighEdgeY),
SOA_COLUMN(float, outerLowEdgeX),
SOA_COLUMN(float, outerLowEdgeY));

GENERATE_SOA_LAYOUT(MiniDoubletsOccupancySoALayout,
SOA_COLUMN(unsigned int, nMDs),
SOA_COLUMN(unsigned int, totOccupancyMDs));

using MiniDoubletsSoA = MiniDoubletsSoALayout<>;
using MiniDoubletsOccupancySoA = MiniDoubletsOccupancySoALayout<>;

using MiniDoublets = MiniDoubletsSoA::View;
using MiniDoubletsConst = MiniDoubletsSoA::ConstView;
using MiniDoubletsOccupancy = MiniDoubletsOccupancySoA::View;
using MiniDoubletsOccupancyConst = MiniDoubletsOccupancySoA::ConstView;

using MiniDoubletsDeviceCollection = PortableCollection2<MiniDoubletsSoA, MiniDoubletsOccupancySoA>;
using MiniDoubletsHostCollection = PortableHostMultiCollection<MiniDoubletsSoA, MiniDoubletsOccupancySoA>;

} // namespace ALPAKA_ACCELERATOR_NAMESPACE::lst

#endif
54 changes: 1 addition & 53 deletions RecoTracker/LSTCore/src/alpaka/MiniDoublet.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,16 @@
#define RecoTracker_LSTCore_src_alpaka_MiniDoublet_h

#include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h"
#include "DataFormats/SoATemplate/interface/SoALayout.h"
#include "DataFormats/Portable/interface/alpaka/PortableCollection.h"

#include "RecoTracker/LSTCore/interface/alpaka/Constants.h"
#include "RecoTracker/LSTCore/interface/MiniDoubletsSoA.h"
#include "RecoTracker/LSTCore/interface/Module.h"
#include "RecoTracker/LSTCore/interface/EndcapGeometry.h"

#include "Hit.h"
#include "ObjectRanges.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {

GENERATE_SOA_LAYOUT(MiniDoubletsSoALayout,
SOA_COLUMN(unsigned int, anchorHitIndices),
SOA_COLUMN(unsigned int, outerHitIndices),
SOA_COLUMN(uint16_t, moduleIndices),
SOA_COLUMN(float, dphichanges),
SOA_COLUMN(float, dzs),
SOA_COLUMN(float, dphis),
SOA_COLUMN(float, shiftedXs),
SOA_COLUMN(float, shiftedYs),
SOA_COLUMN(float, shiftedZs),
SOA_COLUMN(float, noShiftedDphis),
SOA_COLUMN(float, noShiftedDphiChanges),
SOA_COLUMN(float, anchorX),
SOA_COLUMN(float, anchorY),
SOA_COLUMN(float, anchorZ),
SOA_COLUMN(float, anchorRt),
SOA_COLUMN(float, anchorPhi),
SOA_COLUMN(float, anchorEta),
SOA_COLUMN(float, anchorHighEdgeX),
SOA_COLUMN(float, anchorHighEdgeY),
SOA_COLUMN(float, anchorLowEdgeX),
SOA_COLUMN(float, anchorLowEdgeY),
SOA_COLUMN(float, anchorLowEdgePhi),
SOA_COLUMN(float, anchorHighEdgePhi),
SOA_COLUMN(float, outerX),
SOA_COLUMN(float, outerY),
SOA_COLUMN(float, outerZ),
SOA_COLUMN(float, outerRt),
SOA_COLUMN(float, outerPhi),
SOA_COLUMN(float, outerEta),
SOA_COLUMN(float, outerHighEdgeX),
SOA_COLUMN(float, outerHighEdgeY),
SOA_COLUMN(float, outerLowEdgeX),
SOA_COLUMN(float, outerLowEdgeY));

GENERATE_SOA_LAYOUT(MiniDoubletsOccupancySoALayout,
SOA_COLUMN(unsigned int, nMDs),
SOA_COLUMN(unsigned int, totOccupancyMDs));

using MiniDoubletsSoA = MiniDoubletsSoALayout<>;
using MiniDoubletsOccupancySoA = MiniDoubletsOccupancySoALayout<>;

using MiniDoublets = MiniDoubletsSoA::View;
using MiniDoubletsConst = MiniDoubletsSoA::ConstView;
using MiniDoubletsOccupancy = MiniDoubletsOccupancySoA::View;
using MiniDoubletsOccupancyConst = MiniDoubletsOccupancySoA::ConstView;

using MiniDoubletsDeviceCollection = PortableCollection2<MiniDoubletsSoA, MiniDoubletsOccupancySoA>;
using MiniDoubletsHostCollection = PortableHostMultiCollection<MiniDoubletsSoA, MiniDoubletsOccupancySoA>;

template <typename TAcc>
ALPAKA_FN_ACC ALPAKA_FN_INLINE void addMDToMemory(TAcc const& acc,
MiniDoublets mds,
Expand Down

0 comments on commit 66612e8

Please sign in to comment.