-
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
Allow Portable{Collection,Object}<T, TDev> to be used also independently of ALPAKA_ACCELERATOR_NAMESPACE #43310
Conversation
@fwyzard Any thoughts? |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43310/37755
|
A new Pull Request was created by @makortel (Matti Kortelainen) for master. It involves the following packages:
@cmsbuild, @fwyzard, @makortel can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild, please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1d2156/35903/summary.html Comparison SummarySummary:
|
@fwyzard Any comments? |
Sorry for the delay, the LUMI hackathon and the CMS Week got me distracted :-/
OK. A couple of questions:
OK, this cleans it all up anyway :-)
I like best the style of the second commit, but I don't have any concrete objections to the third one. It feels like the second may be easier to extend if there are other special cases in the future - but I guess whatever logic that uses, can also be implemented using So, I like two best, but I'm also OK with three. |
By the way, can you do the same also for |
My personal preference for
I'd think two identical specializations would be technically ok in terms of One Definition Rule. Nevertheless, I think having only one definition would be simplest for future maintenance.
I agree the second commit would be easier to extend. Or, even if such extensions could be done with On the other hand, with just 2 cases the Can you think of a situation where we'd need (or want to have) another special case? (I'm wondering if there is something foreseeable we might want to account already now) The pattern for selecting between host and device collections repeats at least in the pixel PRs. I'd like some simple-to-use facility for users to use, and
Yes. |
The two possibilities I had in mind are Unified Memory and oneAPI CPU devices (OpenCL-based). These might need some special casing of the |
After thinking a bit more, I'm starting to lean towards the second commit, i.e. keeping the trait-based approach here, to have a little bit more flexibility for the future. I'd still advocate the |
…tly of ALPAKA_ACCELERATOR_NAMESPACE
… templates Also move the CopyTo{Host,Device} specialisations to interface/ as they are independent from ALPAKA_ACCELERATOR_NAMESPACE.
e9e99a8
to
1143991
Compare
This update
To me this PR is now complete. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43310/38291
|
@cmsbuild, please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1d2156/36661/summary.html Comparison SummarySummary:
|
+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. @sextonkennedy, @rappoccio, @antoniovilela (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
… it to be used outside of ALPAKA_ACCELERATOR_NAMESPACE I.e. repeat cms-sw#43310 on PortableMultiCollection.
… it to be used outside of ALPAKA_ACCELERATOR_NAMESPACE I.e. repeat cms-sw#43310 on PortableMultiCollection.
… it to be used outside of ALPAKA_ACCELERATOR_NAMESPACE I.e. repeat cms-sw#43310 on PortableMultiCollection.
… it to be used outside of ALPAKA_ACCELERATOR_NAMESPACE I.e. repeat cms-sw#43310 on PortableMultiCollection.
PR description:
This PR makes the
PortableCollection<T, TDev>
andPortableObject<T, TDev>
alias templates usable also independently ofALPAKA_ACCELERATOR_NAMESPACE
. This ability can be useful e.g. for EventSetup data product classes that themselves are templated over the device type (TDev
), and want to use the PortableCollection for SoA storage (e.g. havingPortableCollection
(s) as data members).Furthermore, this PR simplifies the definitions of the
PortableCollection<T, TDev>
andPortableObject<T, TDev>
alias templates. The trait-based approach is kept, but the traits are fully defined and specialized inDataFormats/Portable/interface/Portable{Collection,Object}.h
. In addition, the specializations of theCopyTo{Host,Device}
templates were moved to the headers ininterface/
as well.Old description from the RFC-stage of this PR:
Resolves cms-sw/framework-team#720
PR validation:
Added unit test compiles.