-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add scalar to macro-based SoA example #38877
Conversation
@@ -6,7 +6,7 @@ | |||
<field name="y_" comment="[nElements_]"/> | |||
<field name="z_" comment="[nElements_]"/> | |||
<field name="id_" comment="[nElements_]"/> |
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.
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 don't have strong feelings either way.
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 long as the name is clear (and both are), I don't have a strong opinion either.
@@ -6,7 +6,7 @@ | |||
<field name="y_" comment="[nElements_]"/> | |||
<field name="z_" comment="[nElements_]"/> | |||
<field name="id_" comment="[nElements_]"/> | |||
<field name="metadata()" comment="!"/> | |||
<field name="r_" comment="[scalar_]"/> |
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.
This is the only way I found to make ROOT store a single element owned via a pointer.
The scant documentation seems to suggest that ->
should be used for that, but I couldn't get it to work.
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.
This is the only way I found to make ROOT store a single element owned via a pointer.
The scant documentation seems to suggest that->
should be used for that, but I couldn't get it to work.
@pcanal, any thoughts?
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.
The object pointeed to by a pointer to a class are stored without any annotation. For pointer to a class, the annotation '->' means that the pointer is guaranteed to never be a nullptr (i.e. the default constructor allocates the object).
For numerical type, it is assumed (because a pointer to a single value is longer than just the value) that it points to an array of numerical elements and indeed, you need to give a size.
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 see.
So if I wrap the "scalar" type in a struct
(or union
?) I could use the ->
syntax ?
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.
With a struct and if you initialize the pointer to non-zero in the default constructor, yes you can use ->
(it wont work for a union).
enable gpu |
please test |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38877/31301
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
ff39dce
to
22a63e1
Compare
enable gpu |
please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38877/31302
|
A new Pull Request was created by @fwyzard (Andrea Bocci) for master. It involves the following packages:
@makortel, @fwyzard can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82d89f/26500/summary.html GPU Comparison SummarySummary:
Comparison SummarySummary:
|
@@ -525,6 +525,7 @@ | |||
/* data members */ \ | |||
std::byte* mem_; \ | |||
size_type nElements_; \ | |||
size_type const scalar_ = 1; \ |
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.
Is the scalar_
needed only for the iorule? Could it be constexpr
or static
?
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.
Is the
scalar_
needed only for the iorule?
Yes.
Could it be
constexpr
orstatic
?
No, that doesn't work :-/
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38877/31584
|
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82d89f/26850/summary.html GPU Comparison SummarySummary:
Comparison SummarySummary:
|
+heterogeneous |
let's move forward like this, and postpone any further improvements to future PRs |
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, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
@fwyzard are the changes observed in wf 11634.506 expected as a consequence of the fixes integrated here? e.g. for SiPixelHeterogeneous_PixelTrackSoA: There are apparently reco differences also for the wfs 11634.512 and 11634.522, but the plot of the differences do not show up in https://cmssdt.cern.ch/SDT/jenkins-artifacts/baseLineComparisonsGPU/CMSSW_12_5_X_2022-08-16-1100+82d89f/52160/validateJR.html, |
hi @perrotta, |
please test |
to clarify on top of the question asked at the ORP meeting of Aug 23rd. |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-82d89f/27020/summary.html GPU Comparison SummarySummary:
Comparison SummarySummary:
|
+1 |
PR description:
This PR is a follow up to #38855.
It fixes the return types used in some of the
View
andConstView
accessors, and adds an example of using scalars in a SoA.PR validation:
All unit tests pass.