Skip to content

Commit

Permalink
Replace lambda with a direct initialization of PortableHostObject
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Feb 14, 2024
1 parent a733628 commit d276b1f
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
putTokenMulti2_{produces()},
putTokenMulti3_{produces()},
// create host-side object that gets implicitly copied to all devices of the backend
deviceCache_{[&config]() {
PortableHostObject<TestAlgo::UpdateInfo> obj(cms::alpakatools::host());
*obj = TestAlgo::UpdateInfo{config.getParameter<int32_t>("x"),
config.getParameter<int32_t>("y"),
config.getParameter<int32_t>("z")};
return obj;
}()} {}
deviceCache_{
PortableHostObject<TestAlgo::UpdateInfo>{cms::alpakatools::host(),
TestAlgo::UpdateInfo{config.getParameter<int32_t>("x"),
config.getParameter<int32_t>("y"),
config.getParameter<int32_t>("z")}}} {}

void produce(edm::StreamID, device::Event& iEvent, device::EventSetup const& iSetup) const override {
auto const& input = iEvent.get(getToken_);
Expand Down

0 comments on commit d276b1f

Please sign in to comment.