3 #include <alpaka/alpaka.hpp> 20 using namespace particleFlowRecHitProducer;
22 template <
typename CAL>
27 deviceToken_(produces()),
28 synchronise_(
config.getUntrackedParameter<
bool>(
"synchronise")) {}
32 const int32_t num_recHits =
recHits.size();
34 printf(
"Found %d recHits\n", num_recHits);
37 auto&
view = hostProduct.view();
39 for (
int i = 0;
i < num_recHits;
i++) {
47 alpaka::memcpy(
event.queue(), deviceProduct.buffer(), hostProduct.buffer());
50 event.emplace(deviceToken_,
std::move(deviceProduct));
55 desc.add<
edm::InputTag>(
"src")->setComment(
"Input calorimeter rec hit collection");
56 desc.addUntracked<
bool>(
"synchronise",
false)
57 ->setComment(
"Add synchronisation point after execution (for benchmarking asynchronous execution)");
66 static void convertRecHit(reco::CaloRecHitHostCollection::View::element
to,
67 const typename CAL::CaloRecHitType& from);
void produce(edm::StreamID sid, device::Event &event, device::EventSetup const &) const override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
CaloRecHitSoAProducer(edm::ParameterSet const &config)
CaloRecHitSoAProducer< ECAL > ECALRecHitSoAProducer
CaloRecHitSoAProducer< HCAL > HCALRecHitSoAProducer
const edm::EDGetTokenT< edm::SortedCollection< typename CAL::CaloRecHitType > > recHitsToken_
constexpr float energy() const
static void convertRecHit(reco::CaloRecHitHostCollection::View::element to, const typename CAL::CaloRecHitType &from)
const device::EDPutToken< reco::CaloRecHitDeviceCollection > deviceToken_
constexpr uint32_t flags() const
uint32_t flagsBits() const
constexpr HcalDetId id() const
get the id
constexpr uint32_t rawId() const
get the raw id
DetId id() const
get the id
PortableCollection<::reco::CaloRecHitSoA > CaloRecHitDeviceCollection
constexpr float time() const
#define DEFINE_FWK_ALPAKA_MODULE(name)