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 133 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 135 of file PFRecHitProducerKernel.dev.cc.

References mps_fire::i, dqmiodumpmetadata::n, HLT_2024v13_cff::pfRecHits, HLT_2024v13_cff::topology, and cms::alpakatools::uniform_elements().

139  {
140  // First thread updates size field pfRecHits SoA
141  if (const int32_t thread = alpaka::getIdx<alpaka::Grid, alpaka::Threads>(acc)[0u]; thread == 0)
142  pfRecHits.size() = *num_pfRecHits;
143 
144  // Assign position information and associate neighbours
145  for (int32_t i : cms::alpakatools::uniform_elements(acc, *num_pfRecHits)) {
146  const uint32_t denseId = CAL::detId2denseId(pfRecHits.detId(i));
147 
148  pfRecHits.x(i) = topology.positionX(denseId);
149  pfRecHits.y(i) = topology.positionY(denseId);
150  pfRecHits.z(i) = topology.positionZ(denseId);
151 
152  for (uint32_t n = 0; n < 8; n++) {
153  pfRecHits.neighbours(i)(n) = -1;
154  const uint32_t denseId_neighbour = topology.neighbours(denseId)(n);
155  if (denseId_neighbour != CAL::kInvalidDenseId) {
156  const uint32_t pfRecHit_neighbour = denseId2pfRecHit[denseId_neighbour];
157  if (pfRecHit_neighbour != 0xffffffff)
158  pfRecHits.neighbours(i)(n) = (int32_t)pfRecHit_neighbour;
159  }
160  }
161  }
162  }
ALPAKA_FN_ACC auto uniform_elements(TAcc const &acc, TArgs... args)
Definition: workdivision.h:311