Skip to content

Commit

Permalink
Consistency fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ariostas committed Oct 25, 2024
1 parent 891a97d commit d08032a
Show file tree
Hide file tree
Showing 20 changed files with 95 additions and 37 deletions.
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/EndcapGeometryDevHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_EndcapGeometryDevHostCollection_h
#define RecoTracker_LSTCore_interface_EndcapGeometryDevHostCollection_h

#include "RecoTracker/LSTCore/interface/EndcapGeometryDevSoA.h"
#include "DataFormats/Portable/interface/PortableHostCollection.h"

namespace lst {
using EndcapGeometryDevHostCollection = PortableHostCollection<EndcapGeometryDevSoA>;
} // namespace lst
#endif
2 changes: 0 additions & 2 deletions RecoTracker/LSTCore/interface/EndcapGeometryDevSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ namespace lst {
using EndcapGeometryDev = EndcapGeometryDevSoA::View;
using EndcapGeometryDevConst = EndcapGeometryDevSoA::ConstView;

using EndcapGeometryDevHostCollection = PortableHostCollection<EndcapGeometryDevSoA>;

} // namespace lst

#endif
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/HitsHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_HitsHostCollection_h
#define RecoTracker_LSTCore_interface_HitsHostCollection_h

#include "RecoTracker/LSTCore/interface/HitsSoA.h"
#include "DataFormats/Portable/interface/PortableHostCollection.h"

namespace lst {
using HitsHostCollection = PortableHostMultiCollection<HitsSoA, HitsOccupancySoA>;
} // namespace lst
#endif
4 changes: 2 additions & 2 deletions RecoTracker/LSTCore/interface/HitsSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "DataFormats/SoATemplate/interface/SoALayout.h"
#include "DataFormats/Portable/interface/PortableCollection.h"

#include "RecoTracker/LSTCore/interface/Constants.h"

namespace lst {

GENERATE_SOA_LAYOUT(HitsSoALayout,
Expand Down Expand Up @@ -36,8 +38,6 @@ namespace lst {
using HitsOccupancy = HitsOccupancySoA::View;
using HitsOccupancyConst = HitsOccupancySoA::ConstView;

using HitsHostCollection = PortableHostMultiCollection<HitsSoA, HitsOccupancySoA>;

} // namespace lst

#endif
4 changes: 2 additions & 2 deletions RecoTracker/LSTCore/interface/LSTESData.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define RecoTracker_LSTCore_interface_LSTESData_h

#include "RecoTracker/LSTCore/interface/Constants.h"
#include "RecoTracker/LSTCore/interface/EndcapGeometryDevSoA.h"
#include "RecoTracker/LSTCore/interface/ModulesSoA.h"
#include "RecoTracker/LSTCore/interface/EndcapGeometryDevHostCollection.h"
#include "RecoTracker/LSTCore/interface/ModulesHostCollection.h"
#include "RecoTracker/LSTCore/interface/PixelMap.h"

#include "HeterogeneousCore/AlpakaInterface/interface/CopyToDevice.h"
Expand Down
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/MiniDoubletsHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_MiniDoubletsHostCollection_h
#define RecoTracker_LSTCore_interface_MiniDoubletsHostCollection_h

#include "RecoTracker/LSTCore/interface/MiniDoubletsSoA.h"
#include "DataFormats/Portable/interface/PortableHostCollection.h"

namespace lst {
using MiniDoubletsHostCollection = PortableHostMultiCollection<MiniDoubletsSoA, MiniDoubletsOccupancySoA>;
} // namespace lst
#endif
2 changes: 0 additions & 2 deletions RecoTracker/LSTCore/interface/MiniDoubletsSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ namespace lst {
using MiniDoubletsOccupancy = MiniDoubletsOccupancySoA::View;
using MiniDoubletsOccupancyConst = MiniDoubletsOccupancySoA::ConstView;

using MiniDoubletsHostCollection = PortableHostMultiCollection<MiniDoubletsSoA, MiniDoubletsOccupancySoA>;

} // namespace lst

#endif
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/ModulesHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_ModulesHostCollection_h
#define RecoTracker_LSTCore_interface_ModulesHostCollection_h

#include "RecoTracker/LSTCore/interface/ModulesSoA.h"
#include "DataFormats/Portable/interface/PortableHostCollection.h"

namespace lst {
using ModulesHostCollection = PortableHostMultiCollection<ModulesSoA, ModulesPixelSoA>;
} // namespace lst
#endif
4 changes: 2 additions & 2 deletions RecoTracker/LSTCore/interface/ModulesSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "DataFormats/SoATemplate/interface/SoALayout.h"
#include "DataFormats/Portable/interface/PortableCollection.h"

#include "RecoTracker/LSTCore/interface/Constants.h"

namespace lst {

enum SubDet { InnerPixel = 0, Barrel = 5, Endcap = 4 };
Expand Down Expand Up @@ -50,8 +52,6 @@ namespace lst {
using ModulesPixel = ModulesPixelSoA::View;
using ModulesPixelConst = ModulesPixelSoA::ConstView;

using ModulesHostCollection = PortableHostMultiCollection<ModulesSoA, ModulesPixelSoA>;

} // namespace lst

#endif
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/ObjectRangesHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_ObjectRangesHostCollection_h
#define RecoTracker_LSTCore_interface_ObjectRangesHostCollection_h

#include "RecoTracker/LSTCore/interface/ObjectRangesSoA.h"
#include "DataFormats/Portable/interface/PortableHostCollection.h"

namespace lst {
using ObjectRangesHostCollection = PortableHostMultiCollection<ObjectRangesSoA, ObjectOccupancySoA>;
} // namespace lst
#endif
4 changes: 2 additions & 2 deletions RecoTracker/LSTCore/interface/ObjectRangesSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "DataFormats/SoATemplate/interface/SoALayout.h"
#include "DataFormats/Portable/interface/PortableCollection.h"

#include "RecoTracker/LSTCore/interface/Constants.h"

namespace lst {

GENERATE_SOA_LAYOUT(ObjectRangesSoALayout,
Expand Down Expand Up @@ -43,8 +45,6 @@ namespace lst {
using ObjectOccupancy = ObjectOccupancySoA::View;
using ObjectOccupancyConst = ObjectOccupancySoA::ConstView;

using ObjectRangesHostCollection = PortableHostMultiCollection<ObjectRangesSoA, ObjectOccupancySoA>;

} // namespace lst

#endif
10 changes: 10 additions & 0 deletions RecoTracker/LSTCore/interface/SegmentsHostCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef RecoTracker_LSTCore_interface_SegmentsHostCollection_h
#define RecoTracker_LSTCore_interface_SegmentsHostCollection_h

#include "RecoTracker/LSTCore/interface/SegmentsSoA.h"
#include "DataFormats/Portable/interface/PortableHostCollection.h"

namespace lst {
using SegmentsHostCollection = PortableHostMultiCollection<SegmentsSoA, SegmentsOccupancySoA, SegmentsPixelSoA>;
} // namespace lst
#endif
2 changes: 0 additions & 2 deletions RecoTracker/LSTCore/interface/SegmentsSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ namespace lst {
using SegmentsPixel = SegmentsPixelSoA::View;
using SegmentsPixelConst = SegmentsPixelSoA::ConstView;

using SegmentsHostCollection = PortableHostMultiCollection<SegmentsSoA, SegmentsOccupancySoA, SegmentsPixelSoA>;

} // namespace lst

#endif
1 change: 1 addition & 0 deletions RecoTracker/LSTCore/src/ModuleMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "RecoTracker/LSTCore/interface/Constants.h"
#include "RecoTracker/LSTCore/interface/ModulesSoA.h"
#include "RecoTracker/LSTCore/interface/ModulesHostCollection.h"
#include "RecoTracker/LSTCore/interface/TiltedGeometry.h"
#include "RecoTracker/LSTCore/interface/EndcapGeometry.h"
#include "RecoTracker/LSTCore/interface/ModuleConnectionMap.h"
Expand Down
30 changes: 15 additions & 15 deletions RecoTracker/LSTCore/src/alpaka/Event.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,14 @@ void Event::createMiniDoublets() {
alpaka::memset(queue_, totOccupancyMDs_view, 0u);
}

Vec3D const threadsPerBlockCreateMDInGPU{1, 16, 32};
Vec3D const blocksPerGridCreateMDInGPU{1, nLowerModules_ / threadsPerBlockCreateMDInGPU[1], 1};
WorkDiv3D const createMiniDoubletsInGPUv2_workDiv =
createWorkDiv(blocksPerGridCreateMDInGPU, threadsPerBlockCreateMDInGPU, elementsPerThread);
Vec3D const threadsPerBlockCreateMD{1, 16, 32};
Vec3D const blocksPerGridCreateMD{1, nLowerModules_ / threadsPerBlockCreateMD[1], 1};
WorkDiv3D const createMiniDoublets_workDiv =
createWorkDiv(blocksPerGridCreateMD, threadsPerBlockCreateMD, elementsPerThread);

alpaka::exec<Acc3D>(queue_,
createMiniDoubletsInGPUv2_workDiv,
CreateMiniDoubletsInGPUv2{},
createMiniDoublets_workDiv,
CreateMiniDoublets{},
modules_.const_view<ModulesSoA>(),
hitsDC_->const_view<HitsSoA>(),
hitsDC_->const_view<HitsOccupancySoA>(),
Expand Down Expand Up @@ -435,12 +435,12 @@ void Event::createSegmentsWithModuleMap() {

Vec3D const threadsPerBlockCreateSeg{1, 1, 64};
Vec3D const blocksPerGridCreateSeg{1, 1, nLowerModules_};
WorkDiv3D const createSegmentsInGPUv2_workDiv =
WorkDiv3D const createSegments_workDiv =
createWorkDiv(blocksPerGridCreateSeg, threadsPerBlockCreateSeg, elementsPerThread);

alpaka::exec<Acc3D>(queue_,
createSegmentsInGPUv2_workDiv,
CreateSegmentsInGPUv2{},
createSegments_workDiv,
CreateSegments{},
modules_.const_view<ModulesSoA>(),
miniDoubletsDC_->const_view<MiniDoubletsSoA>(),
miniDoubletsDC_->const_view<MiniDoubletsOccupancySoA>(),
Expand Down Expand Up @@ -691,14 +691,14 @@ void Event::createTrackCandidates(bool no_pls_dupclean, bool tc_pls_triplets) {
hitsDC_->const_view<HitsSoA>(),
quintupletsDC_->const_view<QuintupletsSoA>());

Vec3D const threadsPerBlock_addpLSasTrackCandidateInGPU{1, 1, 384};
Vec3D const blocksPerGrid_addpLSasTrackCandidateInGPU{1, 1, max_blocks};
WorkDiv3D const addpLSasTrackCandidateInGPU_workDiv = createWorkDiv(
blocksPerGrid_addpLSasTrackCandidateInGPU, threadsPerBlock_addpLSasTrackCandidateInGPU, elementsPerThread);
Vec3D const threadsPerBlock_addpLSasTrackCandidate{1, 1, 384};
Vec3D const blocksPerGrid_addpLSasTrackCandidate{1, 1, max_blocks};
WorkDiv3D const addpLSasTrackCandidate_workDiv =
createWorkDiv(blocksPerGrid_addpLSasTrackCandidate, threadsPerBlock_addpLSasTrackCandidate, elementsPerThread);

alpaka::exec<Acc3D>(queue_,
addpLSasTrackCandidateInGPU_workDiv,
AddpLSasTrackCandidateInGPU{},
addpLSasTrackCandidate_workDiv,
AddpLSasTrackCandidate{},
nLowerModules_,
trackCandidatesDC_->view(),
segmentsDC_->const_view<SegmentsOccupancySoA>(),
Expand Down
7 changes: 5 additions & 2 deletions RecoTracker/LSTCore/src/alpaka/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@

#include <optional>

#include "RecoTracker/LSTCore/interface/MiniDoubletsSoA.h"
#include "RecoTracker/LSTCore/interface/HitsHostCollection.h"
#include "RecoTracker/LSTCore/interface/MiniDoubletsHostCollection.h"
#include "RecoTracker/LSTCore/interface/PixelQuintupletsHostCollection.h"
#include "RecoTracker/LSTCore/interface/PixelTripletsHostCollection.h"
#include "RecoTracker/LSTCore/interface/QuintupletsHostCollection.h"
#include "RecoTracker/LSTCore/interface/SegmentsSoA.h"
#include "RecoTracker/LSTCore/interface/SegmentsHostCollection.h"
#include "RecoTracker/LSTCore/interface/TrackCandidatesHostCollection.h"
#include "RecoTracker/LSTCore/interface/TripletsHostCollection.h"
#include "RecoTracker/LSTCore/interface/ObjectRangesHostCollection.h"
#include "RecoTracker/LSTCore/interface/ModulesHostCollection.h"
#include "RecoTracker/LSTCore/interface/alpaka/Constants.h"
#include "RecoTracker/LSTCore/interface/alpaka/LST.h"
#include "RecoTracker/LSTCore/interface/alpaka/MiniDoubletsDeviceCollection.h"
Expand Down
6 changes: 3 additions & 3 deletions RecoTracker/LSTCore/src/alpaka/LST.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ namespace {
maxNHits = Params_pLS::kHits; // pLS

for (unsigned int i = 0; i < maxNHits; i++) {
unsigned int hitIdxInGPU = tcHitIndices[i];
unsigned int hitIdxDev = tcHitIndices[i];
unsigned int hitIdx =
(trackCandidateType == 8)
? hitIdxInGPU
: hitIndices[hitIdxInGPU]; // Hit indices are stored differently in the standalone for pLS.
? hitIdxDev
: hitIndices[hitIdxDev]; // Hit indices are stored differently in the standalone for pLS.

// For p objects, the 3rd and 4th hit maybe the same,
// due to the way pLS hits are stored in the standalone.
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/src/alpaka/MiniDoublet.h
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
}
}

struct CreateMiniDoubletsInGPUv2 {
struct CreateMiniDoublets {
template <typename TAcc>
ALPAKA_FN_ACC void operator()(TAcc const& acc,
ModulesConst modules,
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/src/alpaka/Segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
}
}

struct CreateSegmentsInGPUv2 {
struct CreateSegments {
template <typename TAcc>
ALPAKA_FN_ACC void operator()(TAcc const& acc,
ModulesConst modules,
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/src/alpaka/TrackCandidate.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
}
};

struct AddpLSasTrackCandidateInGPU {
struct AddpLSasTrackCandidate {
template <typename TAcc>
ALPAKA_FN_ACC void operator()(TAcc const& acc,
uint16_t nLowerModules,
Expand Down

0 comments on commit d08032a

Please sign in to comment.