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 1165 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 1168 of file PFClusterSoAProducerKernel.dev.cc.

References cms::alpakatools::elements_with_stride(), mps_fire::i, dqmiolumiharvest::j, cms::alpakatools::once_per_grid(), and HLT_2024v10_cff::pfRecHits.

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