-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Adding recHit masking to extended pixel tracks in heterogeneous CA #51268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| from Configuration.ProcessModifiers.alpaka_cff import alpaka | ||
| from Configuration.ProcessModifiers.pixelTrackMask_cff import pixelTrackMask | ||
| from Configuration.ProcessModifiers.phase2CAExtension_cff import phase2CAExtension | ||
|
|
||
| # collect all PixelTrackMask-related process modifiers here | ||
| allPixelTrackMask = cms.ModifierChain(alpaka,pixelTrackMask,phase2CAExtension) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| pixelTrackMask = cms.Modifier() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,18 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { | |
| ParamsOnDevice const* cpeParams, | ||
| Queue queue) const; | ||
| }; | ||
| class PixelRecHitMaskingKernel { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, since the object does not have any state, could |
||
| public: | ||
| PixelRecHitMaskingKernel() = default; | ||
| ~PixelRecHitMaskingKernel() = default; | ||
|
|
||
| PixelRecHitMaskingKernel(const PixelRecHitMaskingKernel&) = delete; | ||
| PixelRecHitMaskingKernel(PixelRecHitMaskingKernel&&) = delete; | ||
| PixelRecHitMaskingKernel& operator=(const PixelRecHitMaskingKernel&) = delete; | ||
| PixelRecHitMaskingKernel& operator=(PixelRecHitMaskingKernel&&) = delete; | ||
|
|
||
| reco::TrackingRecHitsMaskingCollection makeHitsMaskingAsync(uint32_t const nHits, Queue queue) const; | ||
| }; | ||
| } // namespace pixelgpudetails | ||
| } // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,30 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { | |
| return hits_d; | ||
| } | ||
|
|
||
| TrackingRecHitsMaskingCollection PixelRecHitMaskingKernel::makeHitsMaskingAsync(uint32_t const nHits, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move to |
||
| Queue queue) const { | ||
| using namespace pixelRecHits; | ||
|
|
||
| TrackingRecHitsMaskingCollection mask_d(queue, nHits); | ||
|
|
||
| int threadsPerBlock = 128; | ||
| int blocks = cms::alpakatools::divide_up_by(nHits, threadsPerBlock); | ||
| const auto workDiv1D = cms::alpakatools::make_workdiv<Acc1D>(blocks, threadsPerBlock); | ||
|
|
||
| #ifdef GPU_DEBUG | ||
| std::cout << "launching LaunchZerosPixelMask kernel on " << alpaka::core::demangled<Acc1D> << " with " << blocks | ||
| << " blocks" << std::endl; | ||
| #endif | ||
| alpaka::exec<Acc1D>(queue, workDiv1D, LaunchZerosPixelMask{}, mask_d.view()); | ||
|
|
||
| #ifdef GPU_DEBUG | ||
| alpaka::wait(queue); | ||
| std::cout << "makeHitsMaskingAsync -> DONE!" << std::endl; | ||
| #endif | ||
|
|
||
| return mask_d; | ||
| } | ||
|
|
||
| template class PixelRecHitKernel<pixelTopology::Phase1>; | ||
| template class PixelRecHitKernel<pixelTopology::Phase2>; | ||
| template class PixelRecHitKernel<pixelTopology::HIonPhase1>; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -220,6 +220,17 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { | |
| } | ||
| }; | ||
|
|
||
| class LaunchZerosPixelMask { | ||
| public: | ||
| ALPAKA_FN_ACC void operator()(Acc1D const& acc, ::reco::TrackingRecHitsMaskingView mask) const { | ||
| for (uint32_t ic : cms::alpakatools::independent_group_elements(acc, mask.metadata().size())) { | ||
| assert(ic < (uint32_t)mask.metadata().size()); | ||
| mask[ic].recHitMask() = 0; | ||
| } | ||
| alpaka::syncBlockThreads(acc); | ||
| } | ||
| }; | ||
|
Comment on lines
+223
to
+232
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this kernel could be replaced by |
||
|
|
||
| } // namespace pixelRecHits | ||
| } // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@borzari can you move the new classes to their own headers files (e.g.
DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsMaskingCollection.h), and add them to the serialisation plugins underDataFormats/TrackingRecHitSoA/plugins/andDataFormats/TrackingRecHitSoA/plugins/alpaka/?