3 #include <alpaka/alpaka.hpp> 20 using namespace particleFlowRecHitProducer;
22 template <
typename CAL>
27 deviceToken_(produces()),
28 synchronise_(
config.getUntrackedParameter<
bool>(
"synchronise")) {
30 #ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED 31 producesTemporarily(
"edm::DeviceProduct<alpaka_cuda_async::reco::CaloRecHitDeviceCollection>");
37 const int32_t num_recHits =
recHits.size();
39 printf(
"Found %d recHits\n", num_recHits);
42 auto&
view = hostProduct.view();
44 for (
int i = 0;
i < num_recHits;
i++) {
52 alpaka::memcpy(
event.queue(), deviceProduct.buffer(), hostProduct.buffer());
55 event.emplace(deviceToken_,
std::move(deviceProduct));
61 desc.addUntracked<
bool>(
"synchronise",
false)
62 ->setComment(
"Add synchronisation point after execution (for benchmarking asynchronous execution)");
71 static void convertRecHit(reco::CaloRecHitHostCollection::View::element
to,
72 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)