Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-11-24 00:02:24

0001 #include "TestHelperClass.h"
0002 
0003 namespace ALPAKA_ACCELERATOR_NAMESPACE {
0004   TestHelperClass::TestHelperClass(edm::ParameterSet const& iConfig, edm::ConsumesCollector iC)
0005       : getToken_(iC.consumes(iConfig.getParameter<edm::InputTag>("source"))),
0006         esTokenHost_(iC.esConsumes()),
0007         esTokenDevice_(iC.esConsumes()) {}
0008 
0009   void TestHelperClass::makeAsync(device::Event const& iEvent, device::EventSetup const& iSetup) {
0010     [[maybe_unused]] auto esDataHostHandle = iSetup.getHandle(esTokenHost_);
0011     [[maybe_unused]] auto const& esDataDevice = iSetup.getData(esTokenDevice_);
0012     portabletest::TestDeviceCollection const& deviceProduct = iEvent.get(getToken_);
0013 
0014     hostProduct_ = portabletest::TestHostCollection{deviceProduct->metadata().size(), iEvent.queue()};
0015 
0016     alpaka::memcpy(iEvent.queue(), hostProduct_.buffer(), deviceProduct.const_buffer());
0017   }
0018 }  // namespace ALPAKA_ACCELERATOR_NAMESPACE