CMS 3D CMS Logo

List of all members | Public Member Functions
ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitProducerKernelTopology< CAL > Struct Template Reference

Public Member Functions

template<typename TAcc , typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
ALPAKA_FN_ACC void operator() (const TAcc &acc, const typename CAL::TopologyTypeDevice::ConstView topology, reco::PFRecHitDeviceCollection::View pfRecHits, const uint32_t *__restrict__ denseId2pfRecHit, uint32_t *__restrict__ num_pfRecHits) const
 

Detailed Description

template<typename CAL>
struct ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitProducerKernelTopology< CAL >

Definition at line 122 of file PFRecHitProducerKernel.dev.cc.

Member Function Documentation

◆ operator()()

template<typename CAL >
template<typename TAcc , typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
ALPAKA_FN_ACC void ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitProducerKernelTopology< CAL >::operator() ( const TAcc &  acc,
const typename CAL::TopologyTypeDevice::ConstView  topology,
reco::PFRecHitDeviceCollection::View  pfRecHits,
const uint32_t *__restrict__  denseId2pfRecHit,
uint32_t *__restrict__  num_pfRecHits 
) const
inline

Definition at line 124 of file PFRecHitProducerKernel.dev.cc.

References mps_fire::i, and dqmiodumpmetadata::n.

128  {
129  // First thread updates size field pfRecHits SoA
130  if (const int32_t thread = alpaka::getIdx<alpaka::Grid, alpaka::Threads>(acc)[0u]; thread == 0)
131  pfRecHits.size() = *num_pfRecHits;
132 
133  // Assign position information and associate neighbours
134  for (int32_t i : cms::alpakatools::elements_with_stride(acc, *num_pfRecHits)) {
135  const uint32_t denseId = CAL::detId2denseId(pfRecHits.detId(i));
136 
137  pfRecHits.x(i) = topology.positionX(denseId);
138  pfRecHits.y(i) = topology.positionY(denseId);
139  pfRecHits.z(i) = topology.positionZ(denseId);
140 
141  for (uint32_t n = 0; n < 8; n++) {
142  pfRecHits.neighbours(i)(n) = -1;
143  const uint32_t denseId_neighbour = topology.neighbours(denseId)(n);
144  if (denseId_neighbour != 0xffffffff) {
145  const uint32_t pfRecHit_neighbour = denseId2pfRecHit[denseId_neighbour];
146  if (pfRecHit_neighbour != 0xffffffff)
147  pfRecHits.neighbours(i)(n) = (int32_t)pfRecHit_neighbour;
148  }
149  }
150  }
151  }