-
Notifications
You must be signed in to change notification settings - Fork 47
[cudaautotune] Implementing an autotuning interface and script #380
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
asubah
wants to merge
14
commits into
cms-patatrack:master
Choose a base branch
from
asubah:autotuning
base: master
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 4 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3398a17
[cudaautotune] Forking cuda into cudaautotune
asubah 65a6a83
[cudaautotune] Implement an autotuning interface for CUDA kernels
asubah 9792825
[cudaautotune] Autotuning script for CUDA kernels
asubah 1c720d5
[cudaautotune] Update Makefile to load the correct libraries
asubah c47dd96
update Makefiles
asubah b8d5366
update tuning script to use OpenTuner
asubah d5e995a
new tuning interface
asubah 72567ad
update Makefiles
asubah d3c7d6e
update plugin-PixelTriplets to use the new interface
asubah a4c4fab
update plugin-SiPixelClusterizer to use the new interface
asubah 13ede64
update plugin-SiPixelRecHits to use the new interface
asubah a6a33de
add new configs
asubah 994e6bf
chep2023
asubah 0a8e205
cleaning
asubah 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #ifndef HeterogeneousCore_CUDAUtilities_interface_AtomicPairCounter_h | ||
| #define HeterogeneousCore_CUDAUtilities_interface_AtomicPairCounter_h | ||
|
|
||
| #include <cstdint> | ||
|
|
||
| #include "CUDACore/cudaCompat.h" | ||
|
|
||
| namespace cms { | ||
| namespace cuda { | ||
|
|
||
| class AtomicPairCounter { | ||
| public: | ||
| using c_type = unsigned long long int; | ||
|
|
||
| AtomicPairCounter() {} | ||
| AtomicPairCounter(c_type i) { counter.ac = i; } | ||
|
|
||
| __device__ __host__ AtomicPairCounter& operator=(c_type i) { | ||
| counter.ac = i; | ||
| return *this; | ||
| } | ||
|
|
||
| struct Counters { | ||
| uint32_t n; // in a "One to Many" association is the number of "One" | ||
| uint32_t m; // in a "One to Many" association is the total number of associations | ||
| }; | ||
|
|
||
| union Atomic2 { | ||
| Counters counters; | ||
| c_type ac; | ||
| }; | ||
|
|
||
| static constexpr c_type incr = 1UL << 32; | ||
|
|
||
| __device__ __host__ Counters get() const { return counter.counters; } | ||
|
|
||
| // increment n by 1 and m by i. return previous value | ||
| __host__ __device__ __forceinline__ Counters add(uint32_t i) { | ||
| c_type c = i; | ||
| c += incr; | ||
| Atomic2 ret; | ||
| #ifdef __CUDA_ARCH__ | ||
| ret.ac = atomicAdd(&counter.ac, c); | ||
| #else | ||
| ret.ac = counter.ac; | ||
| counter.ac += c; | ||
| #endif | ||
| return ret.counters; | ||
| } | ||
|
|
||
| private: | ||
| Atomic2 counter; | ||
| }; | ||
|
|
||
| } // namespace cuda | ||
| } // namespace cms | ||
|
|
||
| #endif // HeterogeneousCore_CUDAUtilities_interface_AtomicPairCounter_h |
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.
Could this library be added only in
src/cudaautotune/Makefile?