-
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
Define HOST_DEVICE_CONSTANT to implement constexpr aggregate host/device constants #37159
Conversation
please test |
+heterogeneous |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37159/28712
|
A new Pull Request was created by @fwyzard (Andrea Bocci) for master. It involves the following packages:
can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
-heterogeneous |
This solution does not work for |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-04ea6d/22897/summary.html The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
You can see more details here: Comparison SummarySummary:
|
dbd639c
to
cae2de9
Compare
please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37159/28727
|
Pull request #37159 was updated. @makortel, @smuzaffar, @Dr15Jones can you please check and sign again. |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-04ea6d/22918/summary.html Comparison SummarySummary:
|
+1 |
+core |
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) |
+1 |
PR description:
The use of host-side
consexpr
constants in device code is limited tolong double
)constexpr
functionsIn particular, it's not possible to use
constexpr
scalars by pointer or reference (e.g.std::min()
takes arguments by reference), or passconstexpr
arrays as pointers, or access elements ofconstexpr
arrays outside ofconstexpr
functions.The workaround is to define a macro that evaluates to
constexpr
on the host, and to__device__ constexpr
on the device. Such macro can be used to declare aggregate objects that are available both on the host and on the device.Note these objects may be at different memory addresses on the host and device, so their pointers will be different -- but the actual values should be the same.
PR validation:
None.