CMS 3D CMS Logo

TestHelperClass.cc
Go to the documentation of this file.
2 
3 #include "TestHelperClass.h"
4 
7  : getToken_(iC.consumes(iConfig.getParameter<edm::InputTag>("source"))),
8  getTokenMulti2_(iC.consumes(iConfig.getParameter<edm::InputTag>("source"))),
9  getTokenMulti3_(iC.consumes(iConfig.getParameter<edm::InputTag>("source"))),
10  esTokenHost_(iC.esConsumes()),
11  esTokenDevice_(iC.esConsumes()) {}
12 
14 
16  [[maybe_unused]] auto esDataHostHandle = iSetup.getHandle(esTokenHost_);
17  [[maybe_unused]] auto const& esDataDevice = iSetup.getData(esTokenDevice_);
18  portabletest::TestDeviceCollection const& deviceProduct = iEvent.get(getToken_);
19  portabletest::TestDeviceMultiCollection2 const& deviceProductMulti2 = iEvent.get(getTokenMulti2_);
20  portabletest::TestDeviceMultiCollection3 const& deviceProductMulti3 = iEvent.get(getTokenMulti3_);
21 
22  hostProduct_ = portabletest::TestHostCollection{deviceProduct->metadata().size(), iEvent.queue()};
25 
26  alpaka::memcpy(iEvent.queue(), hostProduct_.buffer(), deviceProduct.const_buffer());
27  alpaka::memcpy(iEvent.queue(), hostProductMulti2_.buffer(), deviceProductMulti2.const_buffer());
28  alpaka::memcpy(iEvent.queue(), hostProductMulti3_.buffer(), deviceProductMulti3.const_buffer());
29  }
30 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
TestHelperClass(edm::ParameterSet const &iConfig, edm::ConsumesCollector iC)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const device::EDGetToken< portabletest::TestDeviceCollection > getToken_
void makeAsync(device::Event const &iEvent, device::EventSetup const &iSetup)
edm::ESHandle< T > getHandle(edm::ESGetToken< T, R > const &iToken) const
Definition: EventSetup.h:49
portabletest::TestHostMultiCollection3 hostProductMulti3_
PortableCollection< TestSoA > TestDeviceCollection
int iEvent
Definition: GenABIO.cc:224
const edm::ESGetToken< cms::alpakatest::ESTestDataA, AlpakaESTestRecordA > esTokenHost_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
T const & getData(edm::ESGetToken< T, R > const &iToken) const
Definition: EventSetup.h:32
const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordC > esTokenDevice_
const device::EDGetToken< portabletest::TestDeviceMultiCollection2 > getTokenMulti2_
HLT enums.
portabletest::TestHostCollection hostProduct_
portabletest::TestHostMultiCollection2 hostProductMulti2_
const device::EDGetToken< portabletest::TestDeviceMultiCollection3 > getTokenMulti3_