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 ()
 
 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_
 
portabletest::TestHostCollection hostProduct_
 

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"))),
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_

Member Function Documentation

◆ fillPSetDescription()

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

Definition at line 11 of file TestHelperClass.cc.

References edm::ParameterSetDescription::add().

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

11 { 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 13 of file TestHelperClass.cc.

References PortableHostCollection< T >::buffer(), PortableDeviceCollection< T, TDev, typename >::const_buffer(), esTokenDevice_, esTokenHost_, ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getData(), ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getHandle(), getToken_, hostProduct_, and iEvent.

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

13  {
14  [[maybe_unused]] auto esDataHostHandle = iSetup.getHandle(esTokenHost_);
15  [[maybe_unused]] auto const& esDataDevice = iSetup.getData(esTokenDevice_);
16  portabletest::TestDeviceCollection const& deviceProduct = iEvent.get(getToken_);
17 
18  hostProduct_ = portabletest::TestHostCollection{deviceProduct->metadata().size(), iEvent.queue()};
19 
20  alpaka::memcpy(iEvent.queue(), hostProduct_.buffer(), deviceProduct.const_buffer());
21  }
const device::EDGetToken< portabletest::TestDeviceCollection > getToken_
PortableCollection< TestSoA > TestDeviceCollection
int iEvent
Definition: GenABIO.cc:224
const edm::ESGetToken< cms::alpakatest::ESTestDataA, AlpakaESTestRecordA > esTokenHost_
const device::ESGetToken< AlpakaESTestDataCDevice, AlpakaESTestRecordC > esTokenDevice_
portabletest::TestHostCollection hostProduct_

◆ 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

Member Data Documentation

◆ esTokenDevice_

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

Definition at line 31 of file TestHelperClass.h.

Referenced by makeAsync().

◆ esTokenHost_

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

Definition at line 30 of file TestHelperClass.h.

Referenced by makeAsync().

◆ getToken_

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

Definition at line 29 of file TestHelperClass.h.

Referenced by makeAsync().

◆ hostProduct_

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

Definition at line 34 of file TestHelperClass.h.

Referenced by makeAsync(), and moveFrom().