forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 5
make CPEFast to better reproduce Generic (w/o track angle) #528
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
Open
VinInn
wants to merge
19
commits into
cms-patatrack:CMSSW_11_2_X_Patatrack
Choose a base branch
from
VinInn:NewErr112
base: CMSSW_11_2_X_Patatrack
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8a7f1e3
Recaftor common ECAL and HCAL code (#523)
mariadalfonso ed5a12c
Improve the CUDAMonitoringService (#506)
makortel c975a28
Synchronise with CMSSW_11_2_0_pre3
fwyzard 5636b6b
Remove use of boost::mpl::vector for dependent records
fwyzard 6006b06
Apply code formatting
fwyzard 548ff29
make CPEFast to better reproduce Generic
VinInn cfad3ee
keep total charge as original one
VinInn 1ab92c1
code format
VinInn 305b06c
move default to 25
VinInn 14e4efb
do not inflate ape
VinInn 535543c
fix doc
VinInn e8a737f
avoid too small sy1 as well
VinInn 57a8077
add Storable SoA on Host
VinInn fb87ec4
set status and store it
VinInn 9e677b8
add ability for errY computable based on track angle
VinInn 1f88577
code format
VinInn ca77477
Merge branch 'master' into NewErr112
fwyzard 020616f
Merge branch 'CMSSW_11_2_X_Patatrack' into NewErr112
VinInn 2d5db6f
Merge branch 'CMSSW_11_2_X_Patatrack' into NewErr112
VinInn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #ifndef CUDADataFormats_TrackingRecHit_interface_SiPixelStatus_H | ||
| #define CUDADataFormats_TrackingRecHit_interface_SiPixelStatus_H | ||
|
|
||
| struct SiPixelStatus { | ||
| uint8_t isBigX : 1; | ||
| uint8_t isOneX : 1; | ||
| uint8_t isBigY : 1; | ||
| uint8_t isOneY : 1; | ||
| uint8_t qBin : 3; | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
CUDADataFormats/TrackingRecHit/interface/TrackingRecHit2DReduced.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #ifndef CUDADataFormats_TrackingRecHit_interface_TrackingRecHit2DReduced_h | ||
| #define CUDADataFormats_TrackingRecHit_interface_TrackingRecHit2DReduced_h | ||
|
|
||
| #include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHit2DSOAView.h" | ||
| #include "CUDADataFormats/Common/interface/HostProduct.h" | ||
|
|
||
| // a reduced (in content and therefore in size) version to be used on CPU for Legacy reconstruction | ||
| class TrackingRecHit2DReduced { | ||
| public: | ||
| using HLPstorage = HostProduct<float[]>; | ||
| using HIDstorage = HostProduct<uint16_t[]>; | ||
|
|
||
| template <typename UP32, typename UP16> | ||
| TrackingRecHit2DReduced(UP32&& istore32, UP16&& istore16, int nhits) | ||
| : m_store32(std::move(istore32)), m_store16(std::move(istore16)), m_nHits(nhits) { | ||
| auto get32 = [&](int i) { return const_cast<float*>(m_store32.get()) + i * nhits; }; | ||
|
|
||
| // copy all the pointers (better be in sync with the producer store) | ||
|
|
||
| m_view.m_xl = get32(0); | ||
| m_view.m_yl = get32(1); | ||
| m_view.m_xerr = get32(2); | ||
| m_view.m_yerr = get32(3); | ||
| m_view.m_chargeAndStatus = reinterpret_cast<uint32_t*>(get32(4)); | ||
| m_view.m_detInd = const_cast<uint16_t*>(m_store16.get()); | ||
| } | ||
|
|
||
| // view only! | ||
| TrackingRecHit2DReduced(TrackingRecHit2DSOAView const& iview, int nhits) : m_view(iview), m_nHits(nhits) {} | ||
|
|
||
| TrackingRecHit2DReduced() = default; | ||
| ~TrackingRecHit2DReduced() = default; | ||
|
|
||
| TrackingRecHit2DReduced(const TrackingRecHit2DReduced&) = delete; | ||
| TrackingRecHit2DReduced& operator=(const TrackingRecHit2DReduced&) = delete; | ||
| TrackingRecHit2DReduced(TrackingRecHit2DReduced&&) = default; | ||
| TrackingRecHit2DReduced& operator=(TrackingRecHit2DReduced&&) = default; | ||
|
|
||
| TrackingRecHit2DSOAView& view() { return m_view; } | ||
| TrackingRecHit2DSOAView const& view() const { return m_view; } | ||
|
|
||
| auto nHits() const { return m_nHits; } | ||
|
|
||
| TrackingRecHit2DSOAView m_view; | ||
|
|
||
| HLPstorage m_store32; | ||
| HIDstorage m_store16; | ||
|
|
||
| int m_nHits; | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 19 additions & 5 deletions
24
CUDADataFormats/TrackingRecHit/src/TrackingRecHit2DCUDA.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,33 @@ | ||
| #include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHit2DCUDA.h" | ||
| #include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHit2DHeterogeneous.h" | ||
| #include "HeterogeneousCore/CUDAUtilities/interface/copyAsync.h" | ||
| #include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" | ||
| #include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" | ||
| #include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h" | ||
|
|
||
| template <> | ||
| cms::cuda::host::unique_ptr<float[]> TrackingRecHit2DCUDA::localCoordToHostAsync(cudaStream_t stream) const { | ||
| auto ret = cms::cuda::make_host_unique<float[]>(4 * nHits(), stream); | ||
| cms::cuda::copyAsync(ret, m_store32, 4 * nHits(), stream); | ||
| cms::cuda::host::unique_ptr<float[]> TrackingRecHit2DGPU::localCoordToHostAsync(cudaStream_t stream) const { | ||
| auto ret = cms::cuda::make_host_unique<float[]>(5 * nHits(), stream); | ||
| cms::cuda::copyAsync(ret, m_store32, 5 * nHits(), stream); | ||
| return ret; | ||
| } | ||
|
|
||
| template <> | ||
| cms::cuda::host::unique_ptr<uint32_t[]> TrackingRecHit2DCUDA::hitsModuleStartToHostAsync(cudaStream_t stream) const { | ||
| cms::cuda::host::unique_ptr<uint16_t[]> TrackingRecHit2DGPU::detIndexToHostAsync(cudaStream_t stream) const { | ||
| auto ret = cms::cuda::make_host_unique<uint16_t[]>(nHits(), stream); | ||
| cms::cuda::copyAsync(ret, m_store16, nHits(), stream); | ||
| return ret; | ||
| } | ||
|
|
||
| template <> | ||
| cms::cuda::host::unique_ptr<uint32_t[]> TrackingRecHit2DGPU::hitsModuleStartToHostAsync(cudaStream_t stream) const { | ||
| auto ret = cms::cuda::make_host_unique<uint32_t[]>(2001, stream); | ||
| cudaCheck(cudaMemcpyAsync(ret.get(), m_hitsModuleStart, 4 * 2001, cudaMemcpyDefault, stream)); | ||
| return ret; | ||
| } | ||
|
|
||
| // the only specialization needed | ||
| template <> | ||
| void TrackingRecHit2DHost::copyFromGPU(TrackingRecHit2DGPU const* input, cudaStream_t stream) { | ||
| assert(input); | ||
| m_store32 = input->localCoordToHostAsync(stream); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
now that we have C++17 both on CPU and GPU, we can just use
if constexpreverywhereUh oh!
There was an error while loading. Please reload this page.
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.
Indeed, I think this was already commented in the integration PRs.
Appears in other places as well.