CMS 3D CMS Logo

List of all members | Public Member Functions
ALPAKA_ACCELERATOR_NAMESPACE::PrepareTopoInputs Class Reference

Public Member Functions

template<typename TAcc , typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
ALPAKA_FN_ACC void operator() (const TAcc &acc, const reco::PFRecHitHostCollection::ConstView pfRecHits, reco::PFClusteringVarsDeviceCollection::View pfClusteringVars, reco::PFClusteringEdgeVarsDeviceCollection::View pfClusteringEdgeVars, uint32_t *__restrict__ nSeeds) const
 

Detailed Description

Definition at line 1164 of file PFClusterSoAProducerKernel.dev.cc.

Member Function Documentation

◆ operator()()

template<typename TAcc , typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
ALPAKA_FN_ACC void ALPAKA_ACCELERATOR_NAMESPACE::PrepareTopoInputs::operator() ( const TAcc &  acc,
const reco::PFRecHitHostCollection::ConstView  pfRecHits,
reco::PFClusteringVarsDeviceCollection::View  pfClusteringVars,
reco::PFClusteringEdgeVarsDeviceCollection::View  pfClusteringEdgeVars,
uint32_t *__restrict__  nSeeds 
) const
inline

Definition at line 1167 of file PFClusterSoAProducerKernel.dev.cc.

References mps_fire::i, dqmiolumiharvest::j, cms::alpakatools::once_per_grid(), HLT_2024v14_cff::pfRecHits, and cms::alpakatools::uniform_elements().

1171  {
1172  const int nRH = pfRecHits.size();
1173 
1174  if (once_per_grid(acc)) {
1175  pfClusteringVars.nEdges() = nRH * 8;
1176  pfClusteringEdgeVars[nRH].pfrh_edgeIdx() = nRH * 8;
1177  }
1178  for (uint32_t i : cms::alpakatools::uniform_elements(acc, nRH)) {
1179  pfClusteringEdgeVars[i].pfrh_edgeIdx() = i * 8;
1180  pfClusteringVars[i].pfrh_topoId() = 0;
1181  for (int j = 0; j < 8; j++) { // checking if neighbours exist and assigning neighbours as edges
1182  if (pfRecHits[i].neighbours()(j) == -1)
1183  pfClusteringEdgeVars[i * 8 + j].pfrh_edgeList() = i;
1184  else
1185  pfClusteringEdgeVars[i * 8 + j].pfrh_edgeList() = pfRecHits[i].neighbours()(j);
1186  }
1187  }
1188 
1189  return;
1190  }
ALPAKA_FN_ACC auto uniform_elements(TAcc const &acc, TArgs... args)
Definition: workdivision.h:311
ALPAKA_FN_ACC constexpr bool once_per_grid(TAcc const &acc)