From 9fb7223a91addddc5c006d8edc93802b817afcc4 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Thu, 2 Jan 2025 20:51:19 +0100 Subject: [PATCH 1/2] Add Transformer compilation test for stream producers --- .../test/stream_producer_t.cppunit.cc | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/FWCore/Framework/test/stream_producer_t.cppunit.cc b/FWCore/Framework/test/stream_producer_t.cppunit.cc index e39a35eb291fd..8a2df1770abc4 100644 --- a/FWCore/Framework/test/stream_producer_t.cppunit.cc +++ b/FWCore/Framework/test/stream_producer_t.cppunit.cc @@ -376,6 +376,44 @@ class testStreamProducer : public CppUnit::TestFixture { m_globalEndLuminosityBlockSummaryCalled = false; } }; + + class TransformProd : public edm::stream::EDProducer { + public: + TransformProd(edm::ParameterSet const&) { + token_ = produces(); + registerTransform(token_, [](float iV) { return int(iV); }); + } + + void produce(edm::Event& iEvent, edm::EventSetup const&) final { + //iEvent.emplace(token_, 3.625); + } + + private: + edm::EDPutTokenT token_; + }; + + class TransformAsyncProd : public edm::stream::EDProducer { + public: + struct IntHolder { + IntHolder() : value_(0) {} + IntHolder(int iV) : value_(iV) {} + int value_; + }; + TransformAsyncProd(edm::ParameterSet const&) { + token_ = produces(); + registerTransformAsync( + token_, + [](float iV, edm::WaitingTaskWithArenaHolder iHolder) { return IntHolder(iV); }, + [](IntHolder iWaitValue) { return iWaitValue.value_; }); + } + + void produce(edm::Event& iEvent, edm::EventSetup const&) final { + //iEvent.emplace(token_, 3.625); + } + + private: + edm::EDPutTokenT token_; + }; }; unsigned int testStreamProducer::BasicProd::m_count = 0; unsigned int testStreamProducer::GlobalProd::m_count = 0; From 0e28aebba890c4109ef68037b7028ed7a5114bd4 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Tue, 31 Dec 2024 00:51:13 +0100 Subject: [PATCH 2/2] Add StreamID parameter to Transformer callback functions The StreamID will be needed to implement implicit host-to-device copies for Alpaka EDProducers --- FWCore/Framework/interface/TransformerBase.h | 6 ++-- .../Framework/interface/global/implementors.h | 20 ++++++----- .../interface/limited/implementors.h | 19 +++++----- FWCore/Framework/interface/one/implementors.h | 35 ++++++++++--------- .../Framework/interface/stream/implementors.h | 20 ++++++----- FWCore/Framework/src/TransformerBase.cc | 17 +++++---- .../Framework/test/global_filter_t.cppunit.cc | 6 ++-- .../test/global_producer_t.cppunit.cc | 6 ++-- .../test/limited_filter_t.cppunit.cc | 2 +- .../test/limited_producer_t.cppunit.cc | 2 +- .../test/stream_producer_t.cppunit.cc | 6 ++-- .../Framework/test/stubs/ToyIntProducers.cc | 5 +-- .../plugins/TransformAsyncIntProducer.cc | 4 +-- .../TransformAsyncIntStreamProducer.cc | 4 +-- .../plugins/TransformIntProducer.cc | 2 +- .../plugins/TransformIntStreamProducer.cc | 2 +- .../interface/alpaka/ProducerBase.h | 4 +-- 17 files changed, 88 insertions(+), 72 deletions(-) diff --git a/FWCore/Framework/interface/TransformerBase.h b/FWCore/Framework/interface/TransformerBase.h index 3753efcfd55af..d417ea46b9807 100644 --- a/FWCore/Framework/interface/TransformerBase.h +++ b/FWCore/Framework/interface/TransformerBase.h @@ -10,6 +10,7 @@ #include "FWCore/Utilities/interface/EDPutToken.h" #include "FWCore/Utilities/interface/SoATuple.h" +#include "FWCore/Utilities/interface/StreamID.h" #include "FWCore/Utilities/interface/TypeID.h" #include "FWCore/Utilities/interface/ProductResolverIndex.h" @@ -38,8 +39,9 @@ namespace edm { protected: //The function takes the WrapperBase corresponding to the data product from the EDPutToken // and returns the WrapperBase associated to the id and instanceName - using TransformFunction = std::function(std::any)>; - using PreTransformFunction = std::function; + using TransformFunction = std::function(edm::StreamID, std::any)>; + using PreTransformFunction = + std::function; void registerTransformImp(ProducerBase&, EDPutToken, const TypeID& id, std::string instanceName, TransformFunction); void registerTransformAsyncImp( diff --git a/FWCore/Framework/interface/global/implementors.h b/FWCore/Framework/interface/global/implementors.h index 6f85763a2a7fd..2eda1fab048f6 100644 --- a/FWCore/Framework/interface/global/implementors.h +++ b/FWCore/Framework/interface/global/implementors.h @@ -474,17 +474,17 @@ namespace edm { template void registerTransform(edm::EDPutTokenT iToken, F iF, std::string productInstance = std::string()) { - using ReturnTypeT = decltype(iF(std::declval())); + using ReturnTypeT = decltype(iF(std::declval(), std::declval())); TypeID returnType(typeid(ReturnTypeT)); TransformerBase::registerTransformImp( *this, EDPutToken(iToken), returnType, std::move(productInstance), - [f = std::move(iF)](std::any const& iGotProduct) { + [f = std::move(iF)](edm::StreamID id, std::any const& iGotProduct) { auto pGotProduct = std::any_cast(iGotProduct); return std::make_unique>( - WrapperBase::Emplace{}, f(*static_cast const*>(pGotProduct)->product())); + WrapperBase::Emplace{}, f(id, *static_cast const*>(pGotProduct)->product())); }); } @@ -493,20 +493,22 @@ namespace edm { P iPre, F iF, std::string productInstance = std::string()) { - using CacheTypeT = decltype(iPre(std::declval(), WaitingTaskWithArenaHolder())); - using ReturnTypeT = decltype(iF(std::declval())); + using CacheTypeT = + decltype(iPre(std::declval(), std::declval(), WaitingTaskWithArenaHolder())); + using ReturnTypeT = decltype(iF(std::declval(), std::declval())); TypeID returnType(typeid(ReturnTypeT)); TransformerBase::registerTransformAsyncImp( *this, EDPutToken(iToken), returnType, std::move(productInstance), - [p = std::move(iPre)](edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) { - return std::any(p(*static_cast const&>(iGotProduct).product(), std::move(iHolder))); + [p = std::move(iPre)]( + edm::StreamID id, edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) { + return std::any(p(id, *static_cast const&>(iGotProduct).product(), std::move(iHolder))); }, - [f = std::move(iF)](std::any const& iCache) { + [f = std::move(iF)](edm::StreamID id, std::any const& iCache) { return std::make_unique>(WrapperBase::Emplace{}, - f(std::any_cast(iCache))); + f(id, std::any_cast(iCache))); }); } diff --git a/FWCore/Framework/interface/limited/implementors.h b/FWCore/Framework/interface/limited/implementors.h index fd8464f08091d..20d15066f46cc 100644 --- a/FWCore/Framework/interface/limited/implementors.h +++ b/FWCore/Framework/interface/limited/implementors.h @@ -462,17 +462,17 @@ namespace edm { template void registerTransform(edm::EDPutTokenT iToken, F iF, std::string productInstance = std::string()) { - using ReturnTypeT = decltype(iF(std::declval())); + using ReturnTypeT = decltype(iF(std::declval(), std::declval())); TypeID returnType(typeid(ReturnTypeT)); TransformerBase::registerTransformImp( *this, EDPutToken(iToken), returnType, std::move(productInstance), - [f = std::move(iF)](std::any const& iGotProduct) { + [f = std::move(iF)](edm::StreamID id, std::any const& iGotProduct) { auto pGotProduct = std::any_cast(iGotProduct); return std::make_unique>( - WrapperBase::Emplace{}, f(*static_cast const*>(pGotProduct)->product())); + WrapperBase::Emplace{}, f(id, *static_cast const*>(pGotProduct)->product())); }); } @@ -481,20 +481,21 @@ namespace edm { P iPre, F iF, std::string productInstance = std::string()) { - using CacheTypeT = decltype(iPre(std::declval(), WaitingTaskWithArenaHolder())); - using ReturnTypeT = decltype(iF(std::declval())); + using CacheTypeT = decltype(iPre(std::declval(), std::declval(), WaitingTaskWithArenaHolder())); + using ReturnTypeT = decltype(iF(std::declval(), std::declval())); TypeID returnType(typeid(ReturnTypeT)); TransformerBase::registerTransformAsyncImp( *this, EDPutToken(iToken), returnType, std::move(productInstance), - [p = std::move(iPre)](edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) { - return std::any(p(*static_cast const&>(iGotProduct).product(), std::move(iHolder))); + [p = std::move(iPre)]( + edm::StreamID id, edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) { + return std::any(p(id, *static_cast const&>(iGotProduct).product(), std::move(iHolder))); }, - [f = std::move(iF)](std::any const& iCache) { + [f = std::move(iF)](edm::StreamID id, std::any const& iCache) { auto cache = std::any_cast(iCache); - return std::make_unique>(WrapperBase::Emplace{}, f(cache)); + return std::make_unique>(WrapperBase::Emplace{}, f(id, cache)); }); } diff --git a/FWCore/Framework/interface/one/implementors.h b/FWCore/Framework/interface/one/implementors.h index 503f0682e20b4..c907636c8ef03 100644 --- a/FWCore/Framework/interface/one/implementors.h +++ b/FWCore/Framework/interface/one/implementors.h @@ -354,17 +354,18 @@ namespace edm { template void registerTransform(edm::EDPutTokenT iToken, F iF, std::string productInstance = std::string()) { - using ReturnTypeT = decltype(iF(std::declval())); + using ReturnTypeT = decltype(iF(std::declval(), std::declval())); TypeID returnType(typeid(ReturnTypeT)); - TransformerBase::registerTransformImp(*this, - EDPutToken(iToken), - returnType, - std::move(productInstance), - [f = std::move(iF)](edm::WrapperBase const& iGotProduct) { - return std::make_unique>( - WrapperBase::Emplace{}, - f(*static_cast const&>(iGotProduct).product())); - }); + TransformerBase::registerTransformImp( + *this, + EDPutToken(iToken), + returnType, + std::move(productInstance), + [f = std::move(iF)](edm::StreamID id, std::any const& iGotProduct) { + auto pGotProduct = std::any_cast(iGotProduct); + return std::make_unique>( + WrapperBase::Emplace{}, f(id, *static_cast const*>(pGotProduct)->product())); + }); } template @@ -372,20 +373,22 @@ namespace edm { P iPre, F iF, std::string productInstance = std::string()) { - using CacheTypeT = decltype(iPre(std::declval(), WaitingTaskWithArenaHolder())); - using ReturnTypeT = decltype(iF(std::declval())); + using CacheTypeT = + decltype(iPre(std::declval(), std::declval(), WaitingTaskWithArenaHolder())); + using ReturnTypeT = decltype(iF(std::declval(), std::declval())); TypeID returnType(typeid(ReturnTypeT)); TransformerBase::registerTransformAsyncImp( *this, EDPutToken(iToken), returnType, std::move(productInstance), - [p = std::move(iPre)](edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) { - return std::any(p(*static_cast const&>(iGotProduct).product(), std::move(iHolder))); + [p = std::move(iPre)]( + edm::StreamID id, edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) { + return std::any(p(id, *static_cast const&>(iGotProduct).product(), std::move(iHolder))); }, - [f = std::move(iF)](std::any const& iCache) { + [f = std::move(iF)](edm::StreamID id, std::any const& iCache) { auto cache = std::any_cast(iCache); - return std::make_unique>(WrapperBase::Emplace{}, f(cache)); + return std::make_unique>(WrapperBase::Emplace{}, f(id, cache)); }); } diff --git a/FWCore/Framework/interface/stream/implementors.h b/FWCore/Framework/interface/stream/implementors.h index b6b557e0ff56e..0adff76076c8c 100644 --- a/FWCore/Framework/interface/stream/implementors.h +++ b/FWCore/Framework/interface/stream/implementors.h @@ -328,17 +328,17 @@ namespace edm { template void registerTransform(edm::EDPutTokenT iToken, F iF, std::string productInstance = std::string()) { - using ReturnTypeT = decltype(iF(std::declval())); + using ReturnTypeT = decltype(iF(std::declval(), std::declval())); TypeID returnType(typeid(ReturnTypeT)); TransformerBase::registerTransformImp( *this, EDPutToken(iToken), returnType, std::move(productInstance), - [f = std::move(iF)](std::any const& iGotProduct) { + [f = std::move(iF)](edm::StreamID id, std::any const& iGotProduct) { auto pGotProduct = std::any_cast(iGotProduct); return std::make_unique>( - WrapperBase::Emplace{}, f(*static_cast const*>(pGotProduct)->product())); + WrapperBase::Emplace{}, f(id, *static_cast const*>(pGotProduct)->product())); }); } @@ -347,20 +347,22 @@ namespace edm { P iPre, F iF, std::string productInstance = std::string()) { - using CacheTypeT = decltype(iPre(std::declval(), WaitingTaskWithArenaHolder())); - using ReturnTypeT = decltype(iF(std::declval())); + using CacheTypeT = + decltype(iPre(std::declval(), std::declval(), WaitingTaskWithArenaHolder())); + using ReturnTypeT = decltype(iF(std::declval(), std::declval())); TypeID returnType(typeid(ReturnTypeT)); TransformerBase::registerTransformAsyncImp( *this, EDPutToken(iToken), returnType, std::move(productInstance), - [p = std::move(iPre)](edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) { - return std::any(p(*static_cast const&>(iGotProduct).product(), std::move(iHolder))); + [p = std::move(iPre)]( + edm::StreamID id, edm::WrapperBase const& iGotProduct, WaitingTaskWithArenaHolder iHolder) { + return std::any(p(id, *static_cast const&>(iGotProduct).product(), std::move(iHolder))); }, - [f = std::move(iF)](std::any const& iCache) { + [f = std::move(iF)](edm::StreamID id, std::any const& iCache) { auto cache = std::any_cast(iCache); - return std::make_unique>(WrapperBase::Emplace{}, f(cache)); + return std::make_unique>(WrapperBase::Emplace{}, f(id, cache)); }); } diff --git a/FWCore/Framework/src/TransformerBase.cc b/FWCore/Framework/src/TransformerBase.cc index b091b968f3ac0..c5cfe9244bbe8 100644 --- a/FWCore/Framework/src/TransformerBase.cc +++ b/FWCore/Framework/src/TransformerBase.cc @@ -9,6 +9,8 @@ #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h" #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h" +#include "FWCore/ServiceRegistry/interface/StreamContext.h" + #include namespace { @@ -116,7 +118,8 @@ namespace edm { std::optional(iIndex), transformInfo_.get(iIndex)))> handle; //transform acquiring signal - TransformAcquiringSignalSentry sentry(iAct, *mcc.getStreamContext(), mcc); + auto const& streamContext = *mcc.getStreamContext(); + TransformAcquiringSignalSentry sentry(iAct, streamContext, mcc); CMS_SA_ALLOW try { handle = iEvent.get(transformInfo_.get(iIndex), transformInfo_.get(iIndex)); } catch (...) { @@ -133,15 +136,16 @@ namespace edm { } else { //transform signal auto mcc = iEvent.moduleCallingContext(); - TransformSignalSentry sentry(iAct, *mcc.getStreamContext(), mcc); + auto const& streamContext = *mcc.getStreamContext(); + TransformSignalSentry sentry(iAct, streamContext, mcc); iEvent.put(iBase.putTokenIndexToProductResolverIndex()[transformInfo_.get(iIndex).index()], - transformInfo_.get(iIndex)(std::move(*cache)), + transformInfo_.get(iIndex)(streamContext.streamID(), std::move(*cache)), handle); } }); WaitingTaskWithArenaHolder wta(*iHolder.group(), nextTask); CMS_SA_ALLOW try { - *cache = transformInfo_.get(iIndex)(*(handle->wrapper()), wta); + *cache = transformInfo_.get(iIndex)(streamContext.streamID(), *(handle->wrapper()), wta); } catch (...) { wta.doneWaiting(std::current_exception()); } @@ -153,9 +157,10 @@ namespace edm { if (handle.wrapper()) { std::any v = handle.wrapper(); //transform signal - TransformSignalSentry sentry(iAct, *mcc.getStreamContext(), mcc); + auto const& streamContext = *mcc.getStreamContext(); + TransformSignalSentry sentry(iAct, streamContext, mcc); iEvent.put(iBase.putTokenIndexToProductResolverIndex()[transformInfo_.get(iIndex).index()], - transformInfo_.get(iIndex)(std::move(v)), + transformInfo_.get(iIndex)(streamContext.streamID(), std::move(v)), handle); } } catch (...) { diff --git a/FWCore/Framework/test/global_filter_t.cppunit.cc b/FWCore/Framework/test/global_filter_t.cppunit.cc index 9e92a7f9f8cb3..af85e7fc9fc5e 100644 --- a/FWCore/Framework/test/global_filter_t.cppunit.cc +++ b/FWCore/Framework/test/global_filter_t.cppunit.cc @@ -357,7 +357,7 @@ class testGlobalFilter : public CppUnit::TestFixture { public: TransformProd(edm::ParameterSet const&) { token_ = produces(); - registerTransform(token_, [](float iV) { return int(iV); }); + registerTransform(token_, [](edm::StreamID, float iV) { return int(iV); }); } bool filter(edm::StreamID, edm::Event& iEvent, edm::EventSetup const&) const { @@ -380,8 +380,8 @@ class testGlobalFilter : public CppUnit::TestFixture { token_ = produces(); registerTransformAsync( token_, - [](float iV, edm::WaitingTaskWithArenaHolder iHolder) { return IntHolder(iV); }, - [](IntHolder iWaitValue) { return iWaitValue.value_; }); + [](edm::StreamID, float iV, edm::WaitingTaskWithArenaHolder iHolder) { return IntHolder(iV); }, + [](edm::StreamID, IntHolder iWaitValue) { return iWaitValue.value_; }); } bool filter(edm::StreamID, edm::Event& iEvent, edm::EventSetup const&) const { diff --git a/FWCore/Framework/test/global_producer_t.cppunit.cc b/FWCore/Framework/test/global_producer_t.cppunit.cc index efb8158bc4315..3dbcfa6b3384f 100644 --- a/FWCore/Framework/test/global_producer_t.cppunit.cc +++ b/FWCore/Framework/test/global_producer_t.cppunit.cc @@ -325,7 +325,7 @@ class testGlobalProducer : public CppUnit::TestFixture { public: TransformProd(edm::ParameterSet const&) { token_ = produces(); - registerTransform(token_, [](float iV) { return int(iV); }); + registerTransform(token_, [](edm::StreamID, float iV) { return int(iV); }); } void produce(edm::StreamID, edm::Event& iEvent, edm::EventSetup const&) const { @@ -347,8 +347,8 @@ class testGlobalProducer : public CppUnit::TestFixture { token_ = produces(); registerTransformAsync( token_, - [](float iV, edm::WaitingTaskWithArenaHolder iHolder) { return IntHolder(iV); }, - [](IntHolder iWaitValue) { return iWaitValue.value_; }); + [](edm::StreamID, float iV, edm::WaitingTaskWithArenaHolder iHolder) { return IntHolder(iV); }, + [](edm::StreamID, IntHolder iWaitValue) { return iWaitValue.value_; }); } void produce(edm::StreamID, edm::Event& iEvent, edm::EventSetup const&) const { diff --git a/FWCore/Framework/test/limited_filter_t.cppunit.cc b/FWCore/Framework/test/limited_filter_t.cppunit.cc index 6df1b73e45204..e811b54cab5d9 100644 --- a/FWCore/Framework/test/limited_filter_t.cppunit.cc +++ b/FWCore/Framework/test/limited_filter_t.cppunit.cc @@ -391,7 +391,7 @@ class testLimitedFilter : public CppUnit::TestFixture { TransformProd(edm::ParameterSet const&) : edm::limited::EDFilterBase(s_pset), edm::limited::EDFilter(s_pset) { token_ = produces(); - registerTransform(token_, [](float iV) { return int(iV); }); + registerTransform(token_, [](edm::StreamID, float iV) { return int(iV); }); } bool filter(edm::StreamID, edm::Event& iEvent, edm::EventSetup const&) const { diff --git a/FWCore/Framework/test/limited_producer_t.cppunit.cc b/FWCore/Framework/test/limited_producer_t.cppunit.cc index c882d73340d87..86472f4effda9 100644 --- a/FWCore/Framework/test/limited_producer_t.cppunit.cc +++ b/FWCore/Framework/test/limited_producer_t.cppunit.cc @@ -357,7 +357,7 @@ class testLimitedProducer : public CppUnit::TestFixture { TransformProd(edm::ParameterSet const&) : edm::limited::EDProducerBase(s_pset), edm::limited::EDProducer(s_pset) { token_ = produces(); - registerTransform(token_, [](float iV) { return int(iV); }); + registerTransform(token_, [](edm::StreamID, float iV) { return int(iV); }); } void produce(edm::StreamID, edm::Event& iEvent, edm::EventSetup const&) const { diff --git a/FWCore/Framework/test/stream_producer_t.cppunit.cc b/FWCore/Framework/test/stream_producer_t.cppunit.cc index 8a2df1770abc4..a34ed3279f558 100644 --- a/FWCore/Framework/test/stream_producer_t.cppunit.cc +++ b/FWCore/Framework/test/stream_producer_t.cppunit.cc @@ -381,7 +381,7 @@ class testStreamProducer : public CppUnit::TestFixture { public: TransformProd(edm::ParameterSet const&) { token_ = produces(); - registerTransform(token_, [](float iV) { return int(iV); }); + registerTransform(token_, [](edm::StreamID, float iV) { return int(iV); }); } void produce(edm::Event& iEvent, edm::EventSetup const&) final { @@ -403,8 +403,8 @@ class testStreamProducer : public CppUnit::TestFixture { token_ = produces(); registerTransformAsync( token_, - [](float iV, edm::WaitingTaskWithArenaHolder iHolder) { return IntHolder(iV); }, - [](IntHolder iWaitValue) { return iWaitValue.value_; }); + [](edm::StreamID, float iV, edm::WaitingTaskWithArenaHolder iHolder) { return IntHolder(iV); }, + [](edm::StreamID, IntHolder iWaitValue) { return iWaitValue.value_; }); } void produce(edm::Event& iEvent, edm::EventSetup const&) final { diff --git a/FWCore/Framework/test/stubs/ToyIntProducers.cc b/FWCore/Framework/test/stubs/ToyIntProducers.cc index 53fb709171be2..4fdaba7c0ec98 100644 --- a/FWCore/Framework/test/stubs/ToyIntProducers.cc +++ b/FWCore/Framework/test/stubs/ToyIntProducers.cc @@ -1001,8 +1001,9 @@ namespace edm::test { public: explicit IntTransformer(edm::ParameterSet const& p) : token_{produces()}, value_(p.getParameter("valueOther")) { - registerTransform(token_, - [](edmtest::ATransientIntProduct const& iV) { return edmtest::IntProduct(iV.value); }); + registerTransform(token_, [](edm::StreamID, edmtest::ATransientIntProduct const& iV) { + return edmtest::IntProduct(iV.value); + }); } void produce(edm::StreamID, edm::Event& e, edm::EventSetup const& c) const final { e.emplace(token_, value_); } diff --git a/FWCore/Integration/plugins/TransformAsyncIntProducer.cc b/FWCore/Integration/plugins/TransformAsyncIntProducer.cc index f239775c49e6d..2137519c4b45b 100644 --- a/FWCore/Integration/plugins/TransformAsyncIntProducer.cc +++ b/FWCore/Integration/plugins/TransformAsyncIntProducer.cc @@ -23,7 +23,7 @@ namespace edmtest { bool check = iPSet.getUntrackedParameter("checkTransformNotCalled"); registerTransformAsync( putToken_, - [offset = transformOffset_, check](auto const& iFrom, auto iTask) { + [offset = transformOffset_, check](edm::StreamID, auto const& iFrom, auto iTask) { if (check) { throw cms::Exception("TransformShouldNotBeCalled"); } @@ -33,7 +33,7 @@ namespace edmtest { ret.value_ = IntProduct(iFrom.value + offset); return ret; }, - [](auto const& iFrom) { + [](edm::StreamID, auto const& iFrom) { iFrom.thread_->join(); return iFrom.value_; }, diff --git a/FWCore/Integration/plugins/TransformAsyncIntStreamProducer.cc b/FWCore/Integration/plugins/TransformAsyncIntStreamProducer.cc index 196c7526a764b..3c0ce428207e9 100644 --- a/FWCore/Integration/plugins/TransformAsyncIntStreamProducer.cc +++ b/FWCore/Integration/plugins/TransformAsyncIntStreamProducer.cc @@ -22,7 +22,7 @@ namespace edmtest { bool check = iPSet.getUntrackedParameter("checkTransformNotCalled"); registerTransformAsync( putToken_, - [offset = transformOffset_, check](auto const& iFrom, auto iTask) { + [offset = transformOffset_, check](edm::StreamID, auto const& iFrom, auto iTask) { if (check) { throw cms::Exception("TransformShouldNotBeCalled"); } @@ -32,7 +32,7 @@ namespace edmtest { ret.value_ = IntProduct(iFrom.value + offset); return ret; }, - [](auto const& iFrom) { + [](edm::StreamID, auto const& iFrom) { iFrom.thread_->join(); return iFrom.value_; }, diff --git a/FWCore/Integration/plugins/TransformIntProducer.cc b/FWCore/Integration/plugins/TransformIntProducer.cc index 29afc7e81d9e5..3aac6f5717389 100644 --- a/FWCore/Integration/plugins/TransformIntProducer.cc +++ b/FWCore/Integration/plugins/TransformIntProducer.cc @@ -16,7 +16,7 @@ namespace edmtest { bool check = iPSet.getUntrackedParameter("checkTransformNotCalled"); registerTransform( putToken_, - [offset = transformOffset_, check](auto const& iFrom) { + [offset = transformOffset_, check](edm::StreamID, auto const& iFrom) { if (check) { throw cms::Exception("TransformShouldNotBeCalled"); } diff --git a/FWCore/Integration/plugins/TransformIntStreamProducer.cc b/FWCore/Integration/plugins/TransformIntStreamProducer.cc index 212287a35bebe..8262525739d42 100644 --- a/FWCore/Integration/plugins/TransformIntStreamProducer.cc +++ b/FWCore/Integration/plugins/TransformIntStreamProducer.cc @@ -15,7 +15,7 @@ namespace edmtest { bool check = iPSet.getUntrackedParameter("checkTransformNotCalled"); registerTransform( putToken_, - [offset = transformOffset_, check](auto const& iFrom) { + [offset = transformOffset_, check](edm::StreamID, auto const& iFrom) { if (check) { throw cms::Exception("TransformShouldNotBeCalled"); } diff --git a/HeterogeneousCore/AlpakaCore/interface/alpaka/ProducerBase.h b/HeterogeneousCore/AlpakaCore/interface/alpaka/ProducerBase.h index a770397765b6f..4bf5cf065096a 100644 --- a/HeterogeneousCore/AlpakaCore/interface/alpaka/ProducerBase.h +++ b/HeterogeneousCore/AlpakaCore/interface/alpaka/ProducerBase.h @@ -96,7 +96,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { using CopyT = cms::alpakatools::CopyToHost; this->registerTransformAsync( token, - [](TToken const& deviceProduct, edm::WaitingTaskWithArenaHolder holder) { + [](edm::StreamID, TToken const& deviceProduct, edm::WaitingTaskWithArenaHolder holder) { auto const& device = alpaka::getDev(deviceProduct.template metadata().queue()); detail::EDMetadataAcquireSentry sentry(device, std::move(holder)); auto metadataPtr = sentry.metadata(); @@ -112,7 +112,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // Wrap possibly move-only type into a copyable type return std::make_shared(std::move(productOnHost), sentry.finish()); }, - [](auto tplPtr) { + [](edm::StreamID, auto tplPtr) { auto& productOnHost = std::get<0>(*tplPtr); if constexpr (requires { CopyT::postCopy(productOnHost); }) { CopyT::postCopy(productOnHost);