CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< SiPixelErrorsSoA
digiErrorPutToken_
 
cms::cuda::SimpleVector
< SiPixelErrorCompact
error_
 
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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 35 of file SiPixelDigiErrorsSoAFromCUDA.cc.

38  digiErrorPutToken_(produces<SiPixelErrorsSoA>()) {}
edm::EDGetTokenT< cms::cuda::Product< SiPixelDigiErrorsCUDA > > digiErrorGetToken_
edm::EDPutTokenT< SiPixelErrorsSoA > digiErrorPutToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelDigiErrorsSoAFromCUDA::~SiPixelDigiErrorsSoAFromCUDA ( )
overridedefault

Member Function Documentation

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

Definition at line 46 of file SiPixelDigiErrorsSoAFromCUDA.cc.

References data_, digiErrorGetToken_, error_, formatterErrors_, eostools::move(), edm::Event::streamID(), and createJobs::tmp.

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  const auto& gpuDigiErrors = ctx.get(iEvent, digiErrorGetToken_);
52  formatterErrors_ = &(gpuDigiErrors.formatterErrors());
53 
54  if (gpuDigiErrors.nErrorWords() == 0)
55  return;
56 
57  auto tmp = gpuDigiErrors.dataErrorToHostAsync(ctx.stream());
58  error_ = tmp.first;
59  data_ = std::move(tmp.second);
60 }
edm::EDGetTokenT< cms::cuda::Product< SiPixelDigiErrorsCUDA > > digiErrorGetToken_
def move
Definition: eostools.py:511
cms::cuda::SimpleVector< SiPixelErrorCompact > error_
StreamID streamID() const
Definition: Event.h:98
const SiPixelFormatterErrors * formatterErrors_
tmp
align.sh
Definition: createJobs.py:716
cms::cuda::host::unique_ptr< SiPixelErrorCompact[]> data_
void SiPixelDigiErrorsSoAFromCUDA::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 40 of file SiPixelDigiErrorsSoAFromCUDA.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

40  {
42  desc.add<edm::InputTag>("src", edm::InputTag("siPixelClustersCUDA"));
43  descriptions.addWithDefaultLabel(desc);
44 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void SiPixelDigiErrorsSoAFromCUDA::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 62 of file SiPixelDigiErrorsSoAFromCUDA.cc.

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

62  {
63  // The following line copies the data from the pinned host memory to
64  // regular host memory. In principle that feels unnecessary (why not
65  // just use the pinned host memory?). There are a few arguments for
66  // doing it though
67  // - Now can release the pinned host memory back to the (caching) allocator
68  // * if we'd like to keep the pinned memory, we'd need to also
69  // keep the CUDA stream around as long as that, or allow pinned
70  // host memory to be allocated without a CUDA stream
71  // - What if a CPU algorithm would produce the same SoA? We can't
72  // use cudaMallocHost without a GPU...
74  error_ = cms::cuda::make_SimpleVector<SiPixelErrorCompact>(0, nullptr);
75  data_.reset();
76  formatterErrors_ = nullptr;
77 }
edm::EDPutTokenT< SiPixelErrorsSoA > digiErrorPutToken_
constexpr int size() const
Definition: SimpleVector.h:109
cms::cuda::SimpleVector< SiPixelErrorCompact > error_
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
constexpr T const * data() const
Definition: SimpleVector.h:111
const SiPixelFormatterErrors * formatterErrors_
cms::cuda::host::unique_ptr< SiPixelErrorCompact[]> data_

Member Data Documentation

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

Definition at line 30 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Referenced by acquire(), and produce().

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

Definition at line 27 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Referenced by acquire().

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

Definition at line 28 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Referenced by produce().

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

Definition at line 31 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Referenced by acquire(), and produce().

const SiPixelFormatterErrors* SiPixelDigiErrorsSoAFromCUDA::formatterErrors_ = nullptr
private

Definition at line 32 of file SiPixelDigiErrorsSoAFromCUDA.cc.

Referenced by acquire(), and produce().