Pixel Alpaka Migration: Portable Product [II]#43295
Conversation
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43295/37711
|
|
A new Pull Request was created by @AdrianoDee (Adriano Di Florio) 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 |
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43295/37712
|
DataFormats/BeamSpot/BuildFile.xml
Outdated
| <use name="clhep"/> | ||
| <use name="DataFormats/Portable"/> | ||
| <use name="HeterogeneousCore/AlpakaInterface"/> | ||
| <flags ALPAKA_BACKENDS="cuda rocm"/> |
There was a problem hiding this comment.
| <flags ALPAKA_BACKENDS="cuda rocm"/> | |
| <flags ALPAKA_BACKENDS="!serial"/> |
is preferred now
| <class name="BeamSpotPOD" ClassVersion="10"> | ||
| <version ClassVersion="10" checksum="280341519"/> |
There was a problem hiding this comment.
New class versions should start with 3
| <class name="BeamSpotPOD" ClassVersion="10"> | |
| <version ClassVersion="10" checksum="280341519"/> | |
| <class name="BeamSpotPOD" ClassVersion="3"> | |
| <version ClassVersion="3" checksum="280341519"/> |
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
|
||
| // generic SoA-based product in device memory |
There was a problem hiding this comment.
I don't see any relation to SoA. The class stores an object of type T in an Alpaka buffer.
|
|
||
| // generic SoA-based product in device memory | ||
| template <typename T, typename TDev, typename = std::enable_if_t<alpaka::isDevice<TDev>>> | ||
| class PortableDeviceProduct { |
There was a problem hiding this comment.
What is the added value of this class compared to plain Alpaka buffer?
I can think of
- can be default-constructed
- handles the data format
const-requirements of the framework correctly
Are these correct? Is something missing?
(I'm mostly trying to understand the situation better, e.g. if we could eventually find a way without this level of indirection)
There was a problem hiding this comment.
How about PortableDeviceObject as the name? The name "product" is quite specific to how framework handles "data products", whereas this class seems to address a bit different concern. Also edm::DeviceProduct<PortableDeviceProduct<Foo>> looks repetitive with the name "Product".
There was a problem hiding this comment.
I can think of
- can be default-constructed
- handles the data format const-requirements of the framework correctly
Are these correct? Is something missing?
I think this were the two main points at the time (@borzari correct me if I'm wrong). And yes, I agree PortableDeviceObject would work better. The same for the host counterpart.
There was a problem hiding this comment.
And for the "general one" would go with PortableObject instead of PortableProduct.
| #include "HeterogeneousCore/AlpakaInterface/interface/host.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" | ||
|
|
||
| // generic SoA-based product in host memory |
There was a problem hiding this comment.
Seems to not have anything to do with SoA either.
| // part of the ROOT read streamer | ||
| static void ROOTReadStreamer(PortableHostProduct* newObj, Product& product) { | ||
| std::cerr << "ROOT object at " << &product << std::endl; | ||
| std::cerr << "id: " << product.id << std::endl; |
There was a problem hiding this comment.
Printouts need to be removed
| Product const* operator->() const { return buffer_->data(); } | ||
|
|
||
| // access the buffer | ||
| Buffer buffer() { return *buffer_; } |
There was a problem hiding this comment.
Could this be
| Buffer buffer() { return *buffer_; } | |
| Buffer& buffer() { return *buffer_; } |
(although I see the same pattern in PortableDeviceCollection)
There was a problem hiding this comment.
No, it really should be a copy.
Otherwise one could modify the internals of the buffer.
|
|
||
| // generic SoA-based product in host memory | ||
| template <typename T> | ||
| class PortableHostProduct { |
There was a problem hiding this comment.
How about PortableHostObject?
| ConstBuffer const_buffer() const { return *buffer_; } | ||
|
|
||
| // part of the ROOT read streamer | ||
| static void ROOTReadStreamer(PortableHostProduct* newObj, Product& product) { |
There was a problem hiding this comment.
Do I understand correctly this function is not currently called? Could you add a test where it is used?
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43295/37732
|
|
enable gpu |
|
please test |
|
+heterogeneous |
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43295/37821
|
|
Pull request #43295 was updated. @jfernan2, @mandrenguyen can you please check and sign again. |
|
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a88f5d/35992/summary.html Comparison SummarySummary:
GPU Comparison SummarySummary:
|
|
The tests are complaining about a namespace in the header files: |
The which is fine (because nothing is added to the global namespace) |
|
@cms-sw/reconstruction-l2 @makortel |
|
+reconstruction |
|
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. @antoniovilela, @sextonkennedy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
|
+1 |
PR description:
This PR stems from #41117 and it's the 2nd of a series of smaller PRs:
It includes the
PortableProductobject and a couple of tests.Keeping track of the comments in PixelTracksAlpaka#40.