CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass Class Reference

#include <TestHelperClass.h>

Public Member Functions

void makeAsync (device::Event const &iEvent, device::EventSetup const &iSetup)
 
portabletest::TestHostCollection moveFrom ()
 
portabletest::TestHostMultiCollection2 moveFromMulti2 ()
 
portabletest::TestHostMultiCollection3 moveFromMulti3 ()
 
 TestHelperClass (edm::ParameterSet const &iConfig, edm::ConsumesCollector iC)
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &iDesc)
 

Private Attributes

const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordCesTokenDevice_
 
const edm::ESGetToken< cms::alpakatest::ESTestDataA, AlpakaESTestRecordAesTokenHost_
 
const device::EDGetToken< portabletest::TestDeviceCollectiongetToken_
 
const device::EDGetToken< portabletest::TestDeviceMultiCollection2getTokenMulti2_
 
const device::EDGetToken< portabletest::TestDeviceMultiCollection3getTokenMulti3_
 
portabletest::TestHostCollection hostProduct_
 
portabletest::TestHostMultiCollection2 hostProductMulti2_
 
portabletest::TestHostMultiCollection3 hostProductMulti3_
 

Detailed Description

Definition at line 18 of file TestHelperClass.h.

Constructor & Destructor Documentation

◆ TestHelperClass()

ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::TestHelperClass ( edm::ParameterSet const &  iConfig,
edm::ConsumesCollector  iC 
)

Definition at line 6 of file TestHelperClass.cc.

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"))),
11  esTokenDevice_(iC.esConsumes()) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const device::EDGetToken< portabletest::TestDeviceCollection > getToken_
const edm::ESGetToken< cms::alpakatest::ESTestDataA, AlpakaESTestRecordA > esTokenHost_
const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordC > esTokenDevice_
const device::EDGetToken< portabletest::TestDeviceMultiCollection2 > getTokenMulti2_
const device::EDGetToken< portabletest::TestDeviceMultiCollection3 > getTokenMulti3_

Member Function Documentation

◆ fillPSetDescription()

void ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::fillPSetDescription ( edm::ParameterSetDescription iDesc)
static

Definition at line 13 of file TestHelperClass.cc.

References edm::ParameterSetDescription::add().

Referenced by ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::fillDescriptions().

13 { iDesc.add<edm::InputTag>("source"); }
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ makeAsync()

void ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::makeAsync ( device::Event const &  iEvent,
device::EventSetup const &  iSetup 
)

Definition at line 15 of file TestHelperClass.cc.

References PortableHostCollection< T >::buffer(), PortableHostMultiCollection< T0, Args >::buffer(), esTokenDevice_, esTokenHost_, ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getData(), ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getHandle(), getToken_, getTokenMulti2_, getTokenMulti3_, hostProduct_, hostProductMulti2_, hostProductMulti3_, iEvent, and PortableHostMultiCollection< T0, Args >::sizes().

Referenced by ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::acquire().

15  {
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  }
const device::EDGetToken< portabletest::TestDeviceCollection > getToken_
portabletest::TestHostMultiCollection3 hostProductMulti3_
PortableCollection< TestSoA > TestDeviceCollection
int iEvent
Definition: GenABIO.cc:224
const edm::ESGetToken< cms::alpakatest::ESTestDataA, AlpakaESTestRecordA > esTokenHost_
const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordC > esTokenDevice_
PortableCollection3< TestSoA, TestSoA2, TestSoA3 > TestDeviceMultiCollection3
const device::EDGetToken< portabletest::TestDeviceMultiCollection2 > getTokenMulti2_
PortableCollection2< TestSoA, TestSoA2 > TestDeviceMultiCollection2
portabletest::TestHostCollection hostProduct_
portabletest::TestHostMultiCollection2 hostProductMulti2_
const device::EDGetToken< portabletest::TestDeviceMultiCollection3 > getTokenMulti3_

◆ moveFrom()

portabletest::TestHostCollection ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::moveFrom ( )
inline

Definition at line 26 of file TestHelperClass.h.

References hostProduct_, and eostools::move().

Referenced by ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::produce().

26 { return std::move(hostProduct_); }
portabletest::TestHostCollection hostProduct_
def move(src, dest)
Definition: eostools.py:511

◆ moveFromMulti2()

portabletest::TestHostMultiCollection2 ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::moveFromMulti2 ( )
inline

Definition at line 27 of file TestHelperClass.h.

References hostProductMulti2_, and eostools::move().

Referenced by ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::produce().

27 { return std::move(hostProductMulti2_); }
def move(src, dest)
Definition: eostools.py:511
portabletest::TestHostMultiCollection2 hostProductMulti2_

◆ moveFromMulti3()

portabletest::TestHostMultiCollection3 ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::moveFromMulti3 ( )
inline

Definition at line 28 of file TestHelperClass.h.

References hostProductMulti3_, and eostools::move().

Referenced by ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::produce().

28 { return std::move(hostProductMulti3_); }
portabletest::TestHostMultiCollection3 hostProductMulti3_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ esTokenDevice_

const device::ESGetToken<AlpakaESTestDataCDevice, AlpakaESTestRecordC> ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::esTokenDevice_
private

Definition at line 35 of file TestHelperClass.h.

Referenced by makeAsync().

◆ esTokenHost_

const edm::ESGetToken<cms::alpakatest::ESTestDataA, AlpakaESTestRecordA> ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::esTokenHost_
private

Definition at line 34 of file TestHelperClass.h.

Referenced by makeAsync().

◆ getToken_

const device::EDGetToken<portabletest::TestDeviceCollection> ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::getToken_
private

Definition at line 31 of file TestHelperClass.h.

Referenced by makeAsync().

◆ getTokenMulti2_

const device::EDGetToken<portabletest::TestDeviceMultiCollection2> ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::getTokenMulti2_
private

Definition at line 32 of file TestHelperClass.h.

Referenced by makeAsync().

◆ getTokenMulti3_

const device::EDGetToken<portabletest::TestDeviceMultiCollection3> ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::getTokenMulti3_
private

Definition at line 33 of file TestHelperClass.h.

Referenced by makeAsync().

◆ hostProduct_

portabletest::TestHostCollection ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::hostProduct_
private

Definition at line 38 of file TestHelperClass.h.

Referenced by makeAsync(), and moveFrom().

◆ hostProductMulti2_

portabletest::TestHostMultiCollection2 ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::hostProductMulti2_
private

Definition at line 39 of file TestHelperClass.h.

Referenced by makeAsync(), and moveFromMulti2().

◆ hostProductMulti3_

portabletest::TestHostMultiCollection3 ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::hostProductMulti3_
private

Definition at line 40 of file TestHelperClass.h.

Referenced by makeAsync(), and moveFromMulti3().