-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
ECAL - Make EcalConstants constexpr arrays compatible with CUDA code #37161
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37161/28721
|
A new Pull Request was created by @thomreis (Thomas Reis) for master. It involves the following packages:
@cmsbuild, @makortel, @civanch, @mdhildreth, @fwyzard can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
DataFormats/EcalDigi/BuildFile.xml
Outdated
@@ -3,6 +3,7 @@ | |||
<use name="DataFormats/DetId"/> | |||
<use name="FWCore/MessageLogger"/> | |||
<use name="FWCore/Utilities"/> | |||
<use name="HeterogeneousCore/CUDAUtilities"/> |
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.
Unfortunately DataFormats
package depending on HeterogeneousCore
is not allowed (in order to avoid dependence on CUDA in persistent data formats).
The header HostDeviceConstant.h
itself depends on CUDA only "weakly" though (it only uses macros that are defined by CUDA-capable compiler and as such it does not require CUDA by itself). Maybe that header should be placed somewhere in DataFormats
instead? (assuming EcalConstants.h
can not be moved to non-dataformat package)
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.
What about moving it to FWCore/Utilities
, like FWCore/Utilities/interface/CMSUnrollLoop.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.
That would work too.
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.
OK, I've updated #37159 accordingly.
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 have updated this one as well.
9791e74
to
c3d3e02
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37161/28734
|
Pull request #37161 was updated. @smuzaffar, @civanch, @Dr15Jones, @makortel, @mdhildreth, @cmsbuild can you please check and sign again. |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b0ee52/22930/summary.html Comparison SummarySummary:
|
+1 |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b0ee52/22986/summary.html Comparison SummarySummary:
|
Hi @cms-sw/simulation-l2 can you please sign this again? |
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
@civanch , do you understand why we now see random differences relval comparisons for Generator e.g in #37161 (comment) ( the the details at https://cmssdt.cern.ch/SDT/jenkins-artifacts/baseLineComparisons/CMSSW_12_3_X_2022-03-09-1100+b0ee52/48838/validateJR.html ) . |
@smuzaffar the idea is that those random differences should disappear after the merging of #37185, since CMSSW_12_3_X_2022-03-10-1100 Since that IB should be already available for the tests, we can relaunch them to verify if it is actually the case |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b0ee52/23020/summary.html Comparison SummarySummary:
|
Random differences in the generator weights have disappeared now, after the merging in the IB of #37185 |
+1 |
PR description:
The constexpr arrays defined in EcalConstants.h can not be used in CUDA kernels because they are no scalar types. With the
HOST_DEVICE_CONSTANT
defined in #37159 it is possible to define the arrays in device memory and use the values.However, using
HOST_DEVICE_CONSTANT
is not possible if the arrays are members of a class and so they are moved to namespaces and constant pointers to the arrays are used in the classes (#36311 (comment)).This PR builds on PR #37159
PR validation:
Compiles and passes 11634.512 on a CPU-only machine and on an GPU equipped machine.