CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiPixelDigiErrorsSoAFromCUDA Class Reference
Inheritance diagram for SiPixelDigiErrorsSoAFromCUDA:
edm::stream::EDProducer< edm::ExternalWork >

Public Member Functions

 SiPixelDigiErrorsSoAFromCUDA (const edm::ParameterSet &iConfig)
 
 ~SiPixelDigiErrorsSoAFromCUDA () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::ExternalWork >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void acquire (const edm::Event &iEvent, const edm::EventSetup &iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) override
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 

Private Attributes

cms::cuda::host::unique_ptr< SiPixelErrorCompact[]> data_
 
edm::EDGetTokenT< cms::cuda::Product< SiPixelDigiErrorsCUDA > > digiErrorGetToken_
 
edm::EDPutTokenT< SiPixelErrorsSoAdigiErrorPutToken_
 
cms::cuda::SimpleVector< SiPixelErrorCompacterror_
 
const SiPixelFormatterErrorsformatterErrors_ = nullptr
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::ExternalWork >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 14 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Constructor & Destructor Documentation

◆ SiPixelDigiErrorsSoAFromCUDA()

SiPixelDigiErrorsSoAFromCUDA::SiPixelDigiErrorsSoAFromCUDA ( const edm::ParameterSet iConfig)
explicit

Definition at line 35 of file SiPixelDigiErrorsSoAFromCUDA.cc.

38  digiErrorPutToken_(produces<SiPixelErrorsSoA>()) {}

◆ ~SiPixelDigiErrorsSoAFromCUDA()

SiPixelDigiErrorsSoAFromCUDA::~SiPixelDigiErrorsSoAFromCUDA ( )
overridedefault

Member Function Documentation

◆ acquire()

void SiPixelDigiErrorsSoAFromCUDA::acquire ( const edm::Event iEvent,
const edm::EventSetup iSetup,
edm::WaitingTaskWithArenaHolder  waitingTaskHolder 
)
overrideprivate

Definition at line 46 of file SiPixelDigiErrorsSoAFromCUDA.cc.

48  {
49  // Do the transfer in a CUDA stream parallel to the computation CUDA stream
50  cms::cuda::ScopedContextAcquire ctx{iEvent.streamID(), std::move(waitingTaskHolder)};
51 
52  const auto& gpuDigiErrors = ctx.get(iEvent, digiErrorGetToken_);
53 
54  auto tmp = gpuDigiErrors.dataErrorToHostAsync(ctx.stream());
55  error_ = tmp.first;
56  data_ = std::move(tmp.second);
57  formatterErrors_ = &(gpuDigiErrors.formatterErrors());
58 }

References data_, digiErrorGetToken_, error_, formatterErrors_, iEvent, eostools::move(), and createJobs::tmp.

◆ fillDescriptions()

void SiPixelDigiErrorsSoAFromCUDA::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

◆ produce()

void SiPixelDigiErrorsSoAFromCUDA::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 60 of file SiPixelDigiErrorsSoAFromCUDA.cc.

60  {
61  // The following line copies the data from the pinned host memory to
62  // regular host memory. In principle that feels unnecessary (why not
63  // just use the pinned host memory?). There are a few arguments for
64  // doing it though
65  // - Now can release the pinned host memory back to the (caching) allocator
66  // * if we'd like to keep the pinned memory, we'd need to also
67  // keep the CUDA stream around as long as that, or allow pinned
68  // host memory to be allocated without a CUDA stream
69  // - What if a CPU algorithm would produce the same SoA? We can't
70  // use cudaMallocHost without a GPU...
72 
73  error_ = cms::cuda::make_SimpleVector<SiPixelErrorCompact>(0, nullptr);
74  data_.reset();
75  formatterErrors_ = nullptr;
76 }

References cms::cuda::SimpleVector< T >::data(), data_, digiErrorPutToken_, error_, formatterErrors_, iEvent, and cms::cuda::SimpleVector< T >::size().

Member Data Documentation

◆ data_

cms::cuda::host::unique_ptr<SiPixelErrorCompact[]> SiPixelDigiErrorsSoAFromCUDA::data_
private

Definition at line 30 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Referenced by acquire(), and produce().

◆ digiErrorGetToken_

edm::EDGetTokenT<cms::cuda::Product<SiPixelDigiErrorsCUDA> > SiPixelDigiErrorsSoAFromCUDA::digiErrorGetToken_
private

Definition at line 27 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Referenced by acquire().

◆ digiErrorPutToken_

edm::EDPutTokenT<SiPixelErrorsSoA> SiPixelDigiErrorsSoAFromCUDA::digiErrorPutToken_
private

Definition at line 28 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Referenced by produce().

◆ error_

cms::cuda::SimpleVector<SiPixelErrorCompact> SiPixelDigiErrorsSoAFromCUDA::error_
private

Definition at line 31 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Referenced by acquire(), and produce().

◆ formatterErrors_

const SiPixelFormatterErrors* SiPixelDigiErrorsSoAFromCUDA::formatterErrors_ = nullptr
private

Definition at line 32 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Referenced by acquire(), and produce().

SiPixelDigiErrorsSoAFromCUDA::data_
cms::cuda::host::unique_ptr< SiPixelErrorCompact[]> data_
Definition: SiPixelDigiErrorsSoAFromCUDA.cc:30
SiPixelDigiErrorsSoAFromCUDA::digiErrorGetToken_
edm::EDGetTokenT< cms::cuda::Product< SiPixelDigiErrorsCUDA > > digiErrorGetToken_
Definition: SiPixelDigiErrorsSoAFromCUDA.cc:27
cms::cuda::SimpleVector::data
constexpr const T * data() const
Definition: SimpleVector.h:111
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
SiPixelDigiErrorsSoAFromCUDA::error_
cms::cuda::SimpleVector< SiPixelErrorCompact > error_
Definition: SiPixelDigiErrorsSoAFromCUDA.cc:31
SiPixelDigiErrorsSoAFromCUDA::digiErrorPutToken_
edm::EDPutTokenT< SiPixelErrorsSoA > digiErrorPutToken_
Definition: SiPixelDigiErrorsSoAFromCUDA.cc:28
iEvent
int iEvent
Definition: GenABIO.cc:224
cms::cuda::ScopedContextAcquire
Definition: ScopedContext.h:101
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
cms::cuda::Product
Definition: Product.h:34
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
cms::cuda::SimpleVector::size
constexpr int size() const
Definition: SimpleVector.h:109
SiPixelDigiErrorsSoAFromCUDA::formatterErrors_
const SiPixelFormatterErrors * formatterErrors_
Definition: SiPixelDigiErrorsSoAFromCUDA.cc:32
edm::InputTag
Definition: InputTag.h:15
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87