-
Notifications
You must be signed in to change notification settings - Fork 1
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
Port alpaka phi functions to DataFormats #142
Port alpaka phi functions to DataFormats #142
Conversation
/run all |
There was a problem while building and running in standalone mode. The logs can be found here. |
The PR was built and ran successfully with CMSSW. Here are some plots. OOTB All TracksThe full set of validation and comparison plots can be found here. |
I updated the CI to 15_0_0_pre1, so now the standalone test works again. I'll think of a way to have the CI always pick the latest release. |
e6c4da9
to
4bf107d
Compare
/run all |
The PR was built and ran successfully in standalone mode. Here are some of the comparison plots. The full set of validation and comparison plots can be found here. Here is a timing comparison:
|
The PR was built and ran successfully with CMSSW. Here are some plots. OOTB All TracksThe full set of validation and comparison plots can be found here. |
4bf107d
to
dbf0fbf
Compare
thanks for the updates. I don't have anything to add; perhaps time to make a PR upstream |
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.
I left a few small comments that are pretty pedantic, but I feel like they could be brought up during the review.
#ifndef DataFormats_Math_alpaka_deltaPhi_h | ||
#define DataFormats_Math_alpaka_deltaPhi_h |
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.
Maybe it should be
#ifndef DataFormats_Math_alpaka_deltaPhi_h | |
#define DataFormats_Math_alpaka_deltaPhi_h | |
#ifndef DataFormats_Math_interface_alpaka_deltaPhi_h | |
#define DataFormats_Math_interface_alpaka_deltaPhi_h |
|
||
// reduce to [-pi,pi] | ||
template <typename TAcc, typename T> | ||
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr T reduceRange(TAcc const& acc, T x) { |
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.
Isn't this name too generic? Maybe reducePhiRange
would be better
// reduce to [-pi,pi] | ||
template <typename TAcc, typename T> | ||
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr T reduceRange(TAcc const& acc, T x) { | ||
constexpr T o2pi = 1. / (2. * M_PI); |
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.
Since CMSSW now uses C++20 you could use std::numbers::pi_v<T>
or std::numbers::inv_pi_v<T>
I agree with all your comments. However, I made sure that the new file closely follows |
Ah okay, that makes sense. Then yeah, it makes more sense to leave it as it is for consistency. |
c043336
to
93b9111
Compare
93b9111
to
b8880cf
Compare
This PR addresses the comments from our CMSSW integration PR where people were asking us to port the generic alpaka functions to CMSSW. I copied our LST functions to the package
DataFormats/Math
, under theinterface/alpaka
folder, which I thought it would be useful for people to add any additional math functions that have been written in alpaka.The functions are not exact copies of what we have in
cmssw/RecoTracker/LSTCore/src/alpaka/Hit.h
Lines 10 to 57 in 3950ee4
as I have tried to generalize, optimize and rename things a bit to be more inline with
https://github.com/SegmentLinking/cmssw/blob/master/DataFormats/Math/interface/deltaPhi.h.
Note that I have not ported the
eta
functions. As far as I checked and tested, it is not used in our code any longer, so it will be deleted in an upcoming PR. Also,calculate_dPhi
can be replaced withcmssw/DataFormats/Math/interface/deltaPhi.h
Line 32 in 3950ee4
so it has also not been ported.
I have used the new functions in place of our current ones and things check out, as can be seen in:
https://uaf-10.t2.ucsd.edu/~evourlio/SDL/CMSSWPR142/compare/
Nothing much to test in this PR but feedback is welcome before I move this to cms-sw.