CMS 3D CMS Logo

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

#include <PFClusterECLCC.h>

Public Member Functions

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

Detailed Description

Definition at line 104 of file PFClusterECLCC.h.

Member Function Documentation

◆ operator()()

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

Definition at line 107 of file PFClusterECLCC.h.

References cms::alpakatools::elements_with_stride(), mps_fire::i, HLT_2024v10_cff::pfRecHits, ALPAKA_ACCELERATOR_NAMESPACE::representative(), runTheMatrix::ret, and findQualityFiles::v.

110  {
111  const int nRH = pfRecHits.size();
112 
113  for (int v : cms::alpakatools::elements_with_stride(acc, nRH)) {
114  const int vstat = pfClusteringVars[v].pfrh_topoId();
115  if (v != vstat) {
116  const int beg = pfClusteringEdgeVars[v].pfrh_edgeIdx();
117  const int end = pfClusteringEdgeVars[v + 1].pfrh_edgeIdx();
118  int vstat = representative(v, pfClusteringVars);
119  for (int i = beg; i < end; i++) {
120  const int nli = pfClusteringEdgeVars[i].pfrh_edgeList();
121  if (v > nli) {
122  int ostat = representative(nli, pfClusteringVars);
123  bool repeat;
124  do {
125  repeat = false;
126  if (vstat != ostat) {
127  int ret;
128  if (vstat < ostat) {
129  if ((ret = alpaka::atomicCas(acc, &pfClusteringVars[ostat].pfrh_topoId(), ostat, vstat)) != ostat) {
130  ostat = ret;
131  repeat = true;
132  }
133  } else {
134  if ((ret = alpaka::atomicCas(acc, &pfClusteringVars[vstat].pfrh_topoId(), vstat, ostat)) != vstat) {
135  vstat = ret;
136  repeat = true;
137  }
138  }
139  }
140  } while (repeat);
141  }
142  }
143  }
144  }
145  }
ret
prodAgent to be discontinued
ALPAKA_FN_ACC int representative(const int idx, reco::PFClusteringVarsDeviceCollection::View pfClusteringVars)
ALPAKA_FN_ACC auto elements_with_stride(TAcc const &acc, TArgs... args)
Definition: workdivision.h:346