CMS 3D CMS Logo

TestCUDAProducerGPU.cc
Go to the documentation of this file.
7 
11 
13 
15 public:
16  explicit TestCUDAProducerGPU(const edm::ParameterSet& iConfig);
17  ~TestCUDAProducerGPU() override = default;
18 
19  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
20 
21  void produce(edm::StreamID streamID, edm::Event& iEvent, edm::EventSetup const& iSetup) const override;
22 
23 private:
28 };
29 
31  : label_(iConfig.getParameter<std::string>("@module_label")),
32  srcToken_(consumes<cms::cuda::Product<cms::cudatest::Thing>>(iConfig.getParameter<edm::InputTag>("src"))),
33  dstToken_(produces<cms::cuda::Product<cms::cudatest::Thing>>()) {}
34 
37  desc.add<edm::InputTag>("src", edm::InputTag())->setComment("Source of cms::cuda::Product<cms::cudatest::Thing>.");
38  descriptions.addWithDefaultLabel(desc);
39  descriptions.setComment(
40  "This EDProducer is part of the TestCUDAProducer* family. It models a GPU algorithm this is not the first "
41  "algorithm in the chain of the GPU EDProducers. Produces cms::cuda::Product<cms::cudatest::Thing>.");
42 }
43 
45  edm::LogVerbatim("TestCUDAProducerGPU") << label_ << " TestCUDAProducerGPU::produce begin event "
46  << iEvent.id().event() << " stream " << iEvent.streamID();
47 
48  auto const& in = iEvent.get(srcToken_);
50  cms::cudatest::Thing const& input = ctx.get(in);
51 
52  ctx.emplace(iEvent, dstToken_, cms::cudatest::Thing{gpuAlgo_.runAlgo(label_, input.get(), ctx.stream())});
53 
54  edm::LogVerbatim("TestCUDAProducerGPU")
55  << label_ << " TestCUDAProducerGPU::produce end event " << iEvent.id().event() << " stream " << iEvent.streamID();
56 }
57 
Log< level::Info, true > LogVerbatim
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
TestCUDAProducerGPUKernel const gpuAlgo_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::EDPutTokenT< cms::cuda::Product< cms::cudatest::Thing > > const dstToken_
static std::string const input
Definition: EdmProvDump.cc:47
int iEvent
Definition: GenABIO.cc:224
std::string const label_
void produce(edm::StreamID streamID, edm::Event &iEvent, edm::EventSetup const &iSetup) const override
~TestCUDAProducerGPU() override=default
Namespace of DDCMS conversion namespace.
void setComment(std::string const &value)
edm::EDGetTokenT< cms::cuda::Product< cms::cudatest::Thing > > const srcToken_
TestCUDAProducerGPU(const edm::ParameterSet &iConfig)
HLT enums.
cms::cuda::device::unique_ptr< float[]> runAlgo(const std::string &label, cudaStream_t stream) const