forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 5
Make the the size of the binner (HistoContainer) settable at run time #590
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
Closed
Closed
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
742aa28
test external storage
VinInn c2623fb
tests passed
VinInn ce24e34
tests passed
VinInn 53081a2
fix all clients
VinInn fc80e1e
code format
VinInn 99e2a46
make the PhiBinner the size of the hits
VinInn 0142a73
code foramt
VinInn 61b45bc
new version with runtime sizes
VinInn 5ddb3d9
do all verification on device
VinInn 9614f31
test runtime
VinInn 3bbf160
test all cases in RT mode
VinInn 8bce16d
code format
VinInn 18d9e55
make HC to inherit from O2MA
VinInn 615f917
fix all instances
VinInn 8318402
code format
VinInn 46029de
add comment, substitute magic
VinInn 0fe1994
simplify interface
VinInn 82c44e6
client updated
VinInn d0340bf
format
VinInn 14d091d
make hit2tuple storage dynamic
VinInn 2d14497
format
VinInn 36176a2
fix block size
VinInn 08afdc9
adding some more debug checks
VinInn f3f56e8
fix debug in producer
VinInn 5983601
fix init&zero
VinInn afdbb29
format
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,49 @@ | ||||||
| #ifndef HeterogeneousCore_CUDAUtilities_interface_FlexiStorage_h | ||||||
| #define HeterogeneousCore_CUDAUtilities_interface_FlexiStorage_h | ||||||
|
|
||||||
| #include <cstdint> | ||||||
|
|
||||||
| namespace cms { | ||||||
| namespace cuda { | ||||||
|
|
||||||
| template <typename I, int S> | ||||||
| class FlexiStorage { | ||||||
| public: | ||||||
| constexpr int capacity() const { return S; } | ||||||
|
|
||||||
| constexpr I& operator[](int i) { return m_v[i]; } | ||||||
| constexpr const I& operator[](int i) const { return m_v[i]; } | ||||||
|
|
||||||
| constexpr I* data() { return m_v; } | ||||||
| constexpr I const* data() const { return m_v; } | ||||||
|
|
||||||
| private: | ||||||
| I m_v[S]; | ||||||
| }; | ||||||
|
|
||||||
| template <typename I> | ||||||
| class FlexiStorage<I, -1> { | ||||||
| public: | ||||||
| constexpr void init(I* v, int s) { | ||||||
| m_v = v; | ||||||
| m_capacity = s; | ||||||
| } | ||||||
|
|
||||||
| constexpr int capacity() const { return m_capacity; } | ||||||
|
|
||||||
| constexpr I& operator[](int i) { return m_v[i]; } | ||||||
| constexpr const I& operator[](int i) const { return m_v[i]; } | ||||||
|
|
||||||
| constexpr I* data() { return m_v; } | ||||||
| constexpr I const* data() const { return m_v; } | ||||||
|
|
||||||
| private: | ||||||
| I* m_v; | ||||||
|
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. would it make sense to use
Suggested change
to handle the ownership of the memory ?
Author
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. it is external storage. This class is allocated on the GPU! |
||||||
| int m_capacity; | ||||||
| }; | ||||||
|
|
||||||
| } // namespace cuda | ||||||
|
|
||||||
| } // namespace cms | ||||||
|
|
||||||
| #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
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.
As suggested by @slava77 here, could you add a comment about what
4and910stand for ?Uh 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.
should be pretty obvious from the code where it is used.
They are of course the number of elements with size 16 and size 32 respectively.
I will add a comment.