-
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
Introduce macros to use reflex attributes #40435
Conversation
please test |
@ericcano FYI |
@makortel @Dr15Jones @pcanal what do you think ? |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-40435/33576
|
A new Pull Request was created by @fwyzard (Andrea Bocci) for master. It involves the following packages:
@makortel, @smuzaffar, @Dr15Jones, @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-7fe410/29811/summary.html Comparison SummarySummary:
|
I think the annotations of class member variables in the class definition is a better way to express the information than using a separate file ( @pcanal Can you think of any (potential) downsides from the ROOT point of view? |
Comparison differences are in 11634.7 (#39803) |
Beside the need for the macro (that maybe we actually should be providing), the main risk is that we currently (i.e. as of right now, I just added it to my todo), we do not test using |
It does work right now, and of course I do not mind making changes to the spelling if needed, or moving t centrally supplied macros. One thing to note, though: I understand that the current version of cling is based on clang 9; more recent versions use (or at least support) a more general syntax for annotations. |
ROOT 6.28 will come with LLVM 13 (and we already have that in the ROOT6_X IBs). |
Can we trigger the tests for the ROOT6_X IB ?
|
@cmsbuild, please test for CMSSW_13_0_ROOT6_X |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-7fe410/29819/summary.html Comparison SummarySummary:
|
OK, so the clang 13-based version of cling works, too. |
I'd say it looks good to me - @makortel, let me know if you prefer different names for the macros or any other changes. |
+heterogeneous |
Pull request #40435 was updated. @makortel, @smuzaffar, @Dr15Jones, @fwyzard can you please check and sign again. |
-1 Failed Tests: UnitTests Unit TestsI found errors in the following unit tests: ---> test test-das-selected-lumis had ERRORS Comparison SummarySummary:
|
+heterogeneous |
The only failed unit test I'd say is unrelated to these changes:
|
+core Comparison failures are in 11634.7 (#39803) |
This pull request is fully signed and it will be integrated in one of the next master IBs (but tests are reportedly failing). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
Please note that the annotations used by rootcling / genreflex are currently an undocumented implementation detail and not part of ROOT's public API. While root-project/root#12012 suggests to change that, I am fairly certain that the spelling of the attributes will change in the process. We are happy to work with you on a solution! Shall we discuss in the ROOT issue? How urgent / important is this feature? |
I know, it took some digging to figure it out :-D
No problem, it should be trivial to update the definition of the macros accordingly.
👍
It's... going in production for data taking in a couple months time :-) |
Well okay, for all means go for it :-) but that also means that making this an official interface isn't as urgent? "Just" important? |
👍🏻 |
+1 Errors are unrelated to this PR |
@rappoccio I believe this PR would need the explicit |
merge |
PR description:
The way dictionary informations are propagated from the C++ code or XML dictionaries to reflex and cling is rather roundabout:
<field name="data_" comment="!"/>
tags in XML dictionaries are parsed bygenreflex
and injected into the LLVM AST of the corresponding C++ code as comments//!
;//!
or//[size_]
are converted bygenreflex
/rootcling
into LLVM AST annotations;cling
parses the LLVM annotations and uses them to generate the desired behaviour in the dictionaries.This approach does not work well with macro-generated data members:
//!
or//[size_]
cannot be used directly;class_def.xml
file, requiring manual intervention for their implementation and maintenance.However, it turns out that dictionaries can bypass the comments and use LLVM annotations directly within the C++ code. So
can be also expressed as
and annotations can be generated by macros.
A new header file,
FWCore/Reflection/interface/reflex.h
, currently implements two macros:EDM_REFLEX_TRANSIENT
can be used to annotate transient data members, like//!
EDM_REFLEX_SIZE(SIZE)
can be used to annotate dynamic arrays, like//[SIZE]
To avoid warning about unrecognised attributes, these macros expand to nothing unless
__CLING__
is defined.The changes to
DataFormats/SoATemplate/interface/SoALayout.h
add these macros to the SoA data members, so they do not need to be explicitly added by hand to the variousclasses_def.xml
files.PR validation:
The SoA unit tests under
HeterogeneousCore/AlpakaTest
andHeterogeneousCore/CUDATest
pass.If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:
No backport expected.