Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DataFormats/BeamSpot/plugins/alpaka/TrivialSerialisation.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "DataFormats/BeamSpot/interface/BeamSpotHost.h"
#include "DataFormats/BeamSpot/interface/alpaka/BeamSpotDevice.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(BeamSpotDevice);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(BeamSpotHost, BeamSpotDevice);
6 changes: 4 additions & 2 deletions DataFormats/EcalDigi/plugins/alpaka/TrivialSerialisation.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "DataFormats/EcalDigi/interface/EcalDigiHostCollection.h"
#include "DataFormats/EcalDigi/interface/EcalDigiPhase2HostCollection.h"
#include "DataFormats/EcalDigi/interface/alpaka/EcalDigiDeviceCollection.h"
#include "DataFormats/EcalDigi/interface/alpaka/EcalDigiPhase2DeviceCollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(EcalDigiDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(EcalDigiPhase2DeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(EcalDigiHostCollection, EcalDigiDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(EcalDigiPhase2HostCollection, EcalDigiPhase2DeviceCollection);
6 changes: 4 additions & 2 deletions DataFormats/EcalRecHit/plugins/alpaka/TrivialSerialisation.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "DataFormats/EcalRecHit/interface/EcalRecHitHostCollection.h"
#include "DataFormats/EcalRecHit/interface/EcalUncalibratedRecHitHostCollection.h"
#include "DataFormats/EcalRecHit/interface/alpaka/EcalRecHitDeviceCollection.h"
#include "DataFormats/EcalRecHit/interface/alpaka/EcalUncalibratedRecHitDeviceCollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(EcalRecHitDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(EcalUncalibratedRecHitDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(EcalRecHitHostCollection, EcalRecHitDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(EcalUncalibratedRecHitHostCollection, EcalUncalibratedRecHitDeviceCollection);
9 changes: 6 additions & 3 deletions DataFormats/HGCalDigi/plugins/alpaka/TrivialSerialisation.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#include "DataFormats/HGCalDigi/interface/HGCalDigiHost.h"
#include "DataFormats/HGCalDigi/interface/HGCalECONDPacketInfoHost.h"
#include "DataFormats/HGCalDigi/interface/HGCalFEDPacketInfoHost.h"
#include "DataFormats/HGCalDigi/interface/alpaka/HGCalDigiDevice.h"
#include "DataFormats/HGCalDigi/interface/alpaka/HGCalECONDPacketInfoDevice.h"
#include "DataFormats/HGCalDigi/interface/alpaka/HGCalFEDPacketInfoDevice.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(hgcaldigi::HGCalDigiDevice);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(hgcaldigi::HGCalECONDPacketInfoDevice);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(hgcaldigi::HGCalFEDPacketInfoDevice);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(hgcaldigi::HGCalDigiHost, hgcaldigi::HGCalDigiDevice);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(hgcaldigi::HGCalECONDPacketInfoHost, hgcaldigi::HGCalECONDPacketInfoDevice);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(hgcaldigi::HGCalFEDPacketInfoHost, hgcaldigi::HGCalFEDPacketInfoDevice);
9 changes: 6 additions & 3 deletions DataFormats/HGCalReco/plugins/alpaka/TrivialSerialisation.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#include "DataFormats/HGCalReco/interface/HGCalSoAClustersHostCollection.h"
#include "DataFormats/HGCalReco/interface/HGCalSoARecHitsExtraHostCollection.h"
#include "DataFormats/HGCalReco/interface/HGCalSoARecHitsHostCollection.h"
#include "DataFormats/HGCalReco/interface/alpaka/HGCalSoAClustersDeviceCollection.h"
#include "DataFormats/HGCalReco/interface/alpaka/HGCalSoARecHitsExtraDeviceCollection.h"
#include "DataFormats/HGCalReco/interface/alpaka/HGCalSoARecHitsDeviceCollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(HGCalSoAClustersDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(HGCalSoARecHitsExtraDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(HGCalSoARecHitsDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(HGCalSoAClustersHostCollection, HGCalSoAClustersDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(HGCalSoARecHitsExtraHostCollection, HGCalSoARecHitsExtraDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(HGCalSoARecHitsHostCollection, HGCalSoARecHitsDeviceCollection);
5 changes: 3 additions & 2 deletions DataFormats/HcalDigi/plugins/alpaka/TrivialSerialisation.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "DataFormats/HcalDigi/interface/HcalDigiHostCollection.h"
#include "DataFormats/HcalDigi/interface/alpaka/HcalDigiDeviceCollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(hcal::Phase0DigiDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(hcal::Phase1DigiDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(hcal::Phase0DigiHostCollection, hcal::Phase0DigiDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(hcal::Phase1DigiHostCollection, hcal::Phase1DigiDeviceCollection);
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "DataFormats/HcalRecHit/interface/HcalRecHitHostCollection.h"
#include "DataFormats/HcalRecHit/interface/alpaka/HcalRecHitDeviceCollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(hcal::RecHitDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(hcal::RecHitHostCollection, hcal::RecHitDeviceCollection);
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
// Include the Eigen core library before including the SoA definitions
#include <Eigen/Core>

#include "DataFormats/ParticleFlowReco/interface/CaloRecHitHostCollection.h"
#include "DataFormats/ParticleFlowReco/interface/PFClusterHostCollection.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecHitFractionHostCollection.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecHitHostCollection.h"
#include "DataFormats/ParticleFlowReco/interface/alpaka/CaloRecHitDeviceCollection.h"
#include "DataFormats/ParticleFlowReco/interface/alpaka/PFClusterDeviceCollection.h"
#include "DataFormats/ParticleFlowReco/interface/alpaka/PFRecHitFractionDeviceCollection.h"
#include "DataFormats/ParticleFlowReco/interface/alpaka/PFRecHitDeviceCollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(reco::CaloRecHitDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(reco::PFClusterDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(reco::PFRecHitFractionDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(reco::PFRecHitDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(reco::CaloRecHitHostCollection, reco::CaloRecHitDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(reco::PFClusterHostCollection, reco::PFClusterDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(reco::PFRecHitFractionHostCollection, reco::PFRecHitFractionDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(reco::PFRecHitHostCollection, reco::PFRecHitDeviceCollection);
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#include "DataFormats/PortableTestObjects/interface/ImageHostCollection.h"
#include "DataFormats/PortableTestObjects/interface/LogitsHostCollection.h"
#include "DataFormats/PortableTestObjects/interface/MaskHostCollection.h"
#include "DataFormats/PortableTestObjects/interface/MultiHeadNetHostCollection.h"
#include "DataFormats/PortableTestObjects/interface/ParticleHostCollection.h"
#include "DataFormats/PortableTestObjects/interface/SimpleNetHostCollection.h"
#include "DataFormats/PortableTestObjects/interface/TestHostCollection.h"
#include "DataFormats/PortableTestObjects/interface/TestHostObject.h"
#include "DataFormats/PortableTestObjects/interface/alpaka/ImageDeviceCollection.h"
#include "DataFormats/PortableTestObjects/interface/alpaka/LogitsDeviceCollection.h"
#include "DataFormats/PortableTestObjects/interface/alpaka/MaskDeviceCollection.h"
Expand All @@ -8,13 +16,15 @@
#include "DataFormats/PortableTestObjects/interface/alpaka/TestDeviceObject.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(portabletest::ImageDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(portabletest::LogitsDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(portabletest::MaskDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(portabletest::MultiHeadNetDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(portabletest::ParticleDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(portabletest::SimpleNetDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(portabletest::TestDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(portabletest::TestDeviceCollection2);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(portabletest::TestDeviceCollection3);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(portabletest::TestDeviceObject);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(portabletest::ImageHostCollection, portabletest::ImageDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(portabletest::LogitsHostCollection, portabletest::LogitsDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(portabletest::MaskHostCollection, portabletest::MaskDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(portabletest::MultiHeadNetHostCollection,
portabletest::MultiHeadNetDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(portabletest::ParticleHostCollection, portabletest::ParticleDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(portabletest::SimpleNetHostCollection,
portabletest::SimpleNetDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(portabletest::TestHostCollection, portabletest::TestDeviceCollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(portabletest::TestHostCollection2, portabletest::TestDeviceCollection2);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(portabletest::TestHostCollection3, portabletest::TestDeviceCollection3);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(portabletest::TestHostObject, portabletest::TestDeviceObject);
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h"
#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(SiPixelClustersSoACollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(SiPixelClustersHost, SiPixelClustersSoACollection);
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsHost.h"
#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisHost.h"
#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h"
#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(SiPixelDigiErrorsSoACollection);
DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(SiPixelDigisSoACollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(SiPixelDigiErrorsHost, SiPixelDigiErrorsSoACollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(SiPixelDigisHost, SiPixelDigisSoACollection);
12 changes: 12 additions & 0 deletions DataFormats/SiStripClusterSoA/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<library file="TrivialSerialisation.cc" name="DataFormatsSiStripClusterSoATrivialSerialisation">
<use name="DataFormats/SiStripClusterSoA"/>
<use name="HeterogeneousCore/TrivialSerialisation"/>
<flags EDM_PLUGIN="1"/>
</library>

<library file="alpaka/TrivialSerialisation.cc" name="DataFormatsSiStripClusterSoATrivialSerialisationPortable">
<use name="DataFormats/SiStripClusterSoA"/>
<use name="HeterogeneousCore/TrivialSerialisation"/>
<flags ALPAKA_BACKENDS="1"/>
<flags EDM_PLUGIN="1"/>
</library>
4 changes: 4 additions & 0 deletions DataFormats/SiStripClusterSoA/plugins/TrivialSerialisation.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "DataFormats/SiStripClusterSoA/interface/SiStripClusterHost.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/SerialiserFactory.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN(sistrip::SiStripClusterHost);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "DataFormats/SiStripClusterSoA/interface/SiStripClusterHost.h"
#include "DataFormats/SiStripClusterSoA/interface/alpaka/SiStripClusterDevice.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(sistrip::SiStripClusterHost, sistrip::SiStripClusterDevice);
13 changes: 13 additions & 0 deletions DataFormats/SiStripDigiSoA/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<library file="TrivialSerialisation.cc" name="DataFormatsSiStripDigiSoATrivialSerialisation">
<use name="DataFormats/SiStripDigiSoA"/>
<use name="HeterogeneousCore/TrivialSerialisation"/>
<flags EDM_PLUGIN="1"/>
</library>

<library file="alpaka/TrivialSerialisation.cc" name="DataFormatsSiStripDigiSoATrivialSerialisationPortable">
<use name="DataFormats/SiStripDigiSoA"/>
<use name="HeterogeneousCore/TrivialSerialisation"/>
<flags ALPAKA_BACKENDS="1"/>
<flags EDM_PLUGIN="1"/>
</library>

4 changes: 4 additions & 0 deletions DataFormats/SiStripDigiSoA/plugins/TrivialSerialisation.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "DataFormats/SiStripDigiSoA/interface/SiStripDigiHost.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/SerialiserFactory.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN(sistrip::SiStripDigiHost);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "DataFormats/SiStripDigiSoA/interface/SiStripDigiHost.h"
#include "DataFormats/SiStripDigiSoA/interface/alpaka/SiStripDigiDevice.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(sistrip::SiStripDigiHost, sistrip::SiStripDigiDevice);
3 changes: 2 additions & 1 deletion DataFormats/TrackSoA/plugins/alpaka/TrivialSerialisation.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "DataFormats/TrackSoA/interface/TracksHost.h"
#include "DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(reco::TracksSoACollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(reco::TracksHost, reco::TracksSoACollection);
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h"
#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(reco::TrackingRecHitsSoACollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(reco::TrackingRecHitHost, reco::TrackingRecHitsSoACollection);
3 changes: 2 additions & 1 deletion DataFormats/VertexSoA/plugins/alpaka/TrivialSerialisation.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "DataFormats/VertexSoA/interface/ZVertexHost.h"
#include "DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h"
#include "HeterogeneousCore/TrivialSerialisation/interface/alpaka/SerialiserFactoryDevice.h"

DEFINE_TRIVIAL_SERIALISER_PLUGIN_DEVICE(reco::ZVertexSoACollection);
DEFINE_TRIVIAL_SERIALISER_PORTABLE_PLUGIN(reco::ZVertexHost, reco::ZVertexSoACollection);
23 changes: 23 additions & 0 deletions FWCore/Framework/interface/global/implementors.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,29 @@ namespace edm {
});
}

// Overload for the registration at runtime of transformers for products
// whose type is not known at compile-time. Non templated on the product
// type.
template <typename P, typename F>
void registerTransformAsync(
edm::EDPutToken iToken, P iPre, F iF, edm::TypeID returnType, std::string productInstance) {
using CacheTypeT = decltype(iPre(std::declval<edm::StreamID>(),
std::declval<edm::WrapperBase const&>(),
std::declval<WaitingTaskWithArenaHolder>()));
TransformerBase::registerTransformAsyncImp(
*this,
iToken,
returnType,
std::move(productInstance),
[p = std::move(iPre)](
edm::StreamID id, edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) {
return std::any(p(id, iGotProduct, std::move(iHolder)));
},
[f = std::move(iF)](edm::StreamID id, std::any iCache) -> std::unique_ptr<edm::WrapperBase> {
return f(id, std::any_cast<CacheTypeT>(std::move(iCache)));
});
}

private:
size_t transformIndex_(edm::ProductDescription const& iBranch) const noexcept final {
return TransformerBase::findMatchingIndex(*this, iBranch);
Expand Down
23 changes: 23 additions & 0 deletions FWCore/Framework/interface/limited/implementors.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,29 @@ namespace edm {
});
}

// Overload for the registration at runtime of transformers for products
// whose type is not known at compile-time. Non templated on the product
// type.
template <typename P, typename F>
void registerTransformAsync(
edm::EDPutToken iToken, P iPre, F iF, edm::TypeID returnType, std::string productInstance) {
using CacheTypeT = decltype(iPre(std::declval<edm::StreamID>(),
std::declval<edm::WrapperBase const&>(),
std::declval<WaitingTaskWithArenaHolder>()));
TransformerBase::registerTransformAsyncImp(
*this,
iToken,
returnType,
std::move(productInstance),
[p = std::move(iPre)](
edm::StreamID id, edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) {
return std::any(p(id, iGotProduct, std::move(iHolder)));
},
[f = std::move(iF)](edm::StreamID id, std::any iCache) -> std::unique_ptr<edm::WrapperBase> {
return f(id, std::any_cast<CacheTypeT>(std::move(iCache)));
});
}

private:
size_t transformIndex_(edm::ProductDescription const& iBranch) const noexcept final {
return TransformerBase::findMatchingIndex(*this, iBranch);
Expand Down
24 changes: 24 additions & 0 deletions FWCore/Framework/interface/stream/implementors.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <cstddef>
#include <functional>
#include <memory>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
Expand Down Expand Up @@ -369,6 +370,29 @@ namespace edm {
});
}

// Overload for the registration at runtime of transformers for products
// whose type is not known at compile-time. Non templated on the product
// type.
template <typename P, typename F>
void registerTransformAsync(
edm::EDPutToken iToken, P iPre, F iF, edm::TypeID returnType, std::string productInstance) {
using CacheTypeT = decltype(iPre(std::declval<edm::StreamID>(),
std::declval<edm::WrapperBase const&>(),
std::declval<WaitingTaskWithArenaHolder>()));
TransformerBase::registerTransformAsyncImp(
*this,
iToken,
returnType,
std::move(productInstance),
[p = std::move(iPre)](
edm::StreamID id, edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) {
return std::any(p(id, iGotProduct, std::move(iHolder)));
},
[f = std::move(iF)](edm::StreamID id, std::any iCache) -> std::unique_ptr<edm::WrapperBase> {
return f(id, std::any_cast<CacheTypeT>(std::move(iCache)));
});
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extend this overload to the other module base classes that provide Transformer (that is, global and limited).

The real test suite for the Transformer is in

<test name="testFWCoreIntegrationTransform" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py"/>
<test name="testFWCoreIntegrationTransform_async" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --async_"/>
<test name="testFWCoreIntegrationTransform_async_tracer" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --async_ --addTracer 2>&amp;1 | fgrep 'transform in event' | wc | awk '{print $1}' | fgrep 24"/>
<test name="testFWCoreIntegrationTransform_onPath" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --onPath"/>
<test name="testFWCoreIntegrationTransform_onPath_async" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --onPath --async_"/>
<test name="testFWCoreIntegrationTransform_noTransform" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --noTransform"/>
<test name="testFWCoreIntegrationTransform_noTransform_async" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --noTransform --async_"/>
<test name="testFWCoreIntegrationTransform_noTransform_onPath" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --noTransform --onPath"/>
<test name="testFWCoreIntegrationTransform_noTransform_onPath_async" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --noTransform --onPath --async_"/>
<test name="testFWCoreIntegrationTransform_stream" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --stream"/>
<test name="testFWCoreIntegrationTransform_stream_async" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --stream --async_"/>
<test name="testFWCoreIntegrationTransform_stream_onPath" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --stream --onPath"/>
<test name="testFWCoreIntegrationTransform_stream_onPath_async" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --stream --onPath --async_"/>
<test name="testFWCoreIntegrationTransform_noPut" command="! cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --noPut"/>
<test name="testFWCoreIntegrationTransform_noPut_async" command="! cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --noPut --async_"/>
<test name="testFWCoreIntegrationTransform_exception" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --exception 2>&amp;1 | fgrep 'exception for testing purposes'"/>
<test name="testFWCoreIntegrationTransform_async_exception" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --async --exception 2>&amp;1 | fgrep 'exception for testing purposes'"/>
<test name="testFWCoreIntegrationTransform_onPath_exception" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --onPath --exception 2>&amp;1 | fgrep 'exception for testing purposes'"/>
<test name="testFWCoreIntegrationTransform_onPath_async_exception" command="cmsRun ${LOCALTOP}/src/FWCore/Integration/test/transformTest_cfg.py --onPath --async --exception 2>&amp;1 | fgrep 'exception for testing purposes'"/>

Could you extend those to cover this overload as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see! Thank you. I extended the overload to the global and limited implementors.h

To test the untyped registerTransformAsync, I added two FWCore/Integration/plugins:

  • TransformAsyncIntUntypedProducer.cc, based on TransformAsyncIntProducer.cc, and
  • TransformAsyncIntStreamUntypedProducer.cc, based on TransformAsyncIntStreamProducer.cc.

Unless I somehow missed them, it looks like there are currently no equivalent tests for limited producers. If there is no specific reason for this I can add them (both for the typed and for the untyped transformers)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no specific reason for the omission of limited producers in the tests. I'm not asking you to add them, but if you are want to do that, I'd certainly appreciate it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks. I added TransformIntLimitedProducer.cc, TransformAsyncIntLimitedProducer.cc, and TransformAsyncIntLimitedUntypedProducer.cc plugins, and the same tests for them that we already had for global and stream transformers.

I also moved all test-related changes to a separate commit, if that's ok.


private:
size_t transformIndex_(edm::ProductDescription const& iBranch) const noexcept final {
return TransformerBase::findMatchingIndex(*this, iBranch);
Expand Down
5 changes: 4 additions & 1 deletion FWCore/Integration/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,13 @@
<use name="clhep"/>
</library>

<library file="TransformIntProducer.cc, TransformIntStreamProducer.cc, TransformAsyncIntProducer.cc, TransformAsyncIntStreamProducer.cc" name = "FWCoreIntegrationTransformIntProducer">
<library file="TransformIntProducer.cc, TransformIntStreamProducer.cc, TransformIntLimitedProducer.cc, TransformAsyncIntProducer.cc, TransformAsyncIntStreamProducer.cc, TransformAsyncIntUntypedProducer.cc, TransformAsyncIntStreamUntypedProducer.cc, TransformAsyncIntLimitedProducer.cc, TransformAsyncIntLimitedUntypedProducer.cc" name = "FWCoreIntegrationTransformIntProducer">
<flags EDM_PLUGIN="1"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/TestObjects"/>
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
</library>

</environment>
Loading