CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel Class Reference

#include <PFClusterSoAProducerKernel.h>

Public Member Functions

void cluster (Queue &queue, const reco::PFClusterParamsDeviceCollection &params, const reco::PFRecHitHCALTopologyDeviceCollection &topology, reco::PFClusteringVarsDeviceCollection &pfClusteringVars, reco::PFClusteringEdgeVarsDeviceCollection &pfClusteringEdgeVars, const reco::PFRecHitHostCollection &pfRecHits, reco::PFClusterDeviceCollection &pfClusters, reco::PFRecHitFractionDeviceCollection &pfrhFractions)
 
 PFClusterProducerKernel (Queue &queue, const reco::PFRecHitHostCollection &pfRecHits)
 
void seedTopoAndContract (Queue &queue, const reco::PFClusterParamsDeviceCollection &params, const reco::PFRecHitHCALTopologyDeviceCollection &topology, reco::PFClusteringVarsDeviceCollection &pfClusteringVars, reco::PFClusteringEdgeVarsDeviceCollection &pfClusteringEdgeVars, const reco::PFRecHitHostCollection &pfRecHits, reco::PFClusterDeviceCollection &pfClusters, uint32_t *__restrict__ nRHF)
 

Private Attributes

cms::alpakatools::device_buffer< Device, float[]> globalClusterEnergy
 
cms::alpakatools::device_buffer< Device, reco::pfClustering::Position4[]> globalClusterPos
 
cms::alpakatools::device_buffer< Device, reco::pfClustering::Position4[]> globalPrevClusterPos
 
cms::alpakatools::device_buffer< Device, int[]> globalRechits
 
cms::alpakatools::device_buffer< Device, float[]> globalRhFracSum
 
cms::alpakatools::device_buffer< Device, int[]> globalSeeds
 
cms::alpakatools::device_buffer< Device, uint32_t > nSeeds
 

Detailed Description

Definition at line 38 of file PFClusterSoAProducerKernel.h.

Constructor & Destructor Documentation

◆ PFClusterProducerKernel()

ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::PFClusterProducerKernel ( Queue &  queue,
const reco::PFRecHitHostCollection pfRecHits 
)

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

References nSeeds, and createBeamHaloJobs::queue.

1458  : nSeeds(cms::alpakatools::make_device_buffer<uint32_t>(queue)),
1468  alpaka::memset(queue, nSeeds, 0x00); // Reset nSeeds
1469  }
static constexpr uint32_t blocksForExoticClusters
cms::alpakatools::device_buffer< Device, uint32_t > nSeeds
std::enable_if_t< alpaka::isDevice< TDev > and not std::is_array_v< T >, device_buffer< TDev, T > > make_device_buffer(TDev const &device)
Definition: memory.h:185
cms::alpakatools::device_buffer< Device, reco::pfClustering::Position4[]> globalPrevClusterPos
cms::alpakatools::device_buffer< Device, int[]> globalSeeds
cms::alpakatools::device_buffer< Device, float[]> globalRhFracSum
cms::alpakatools::device_buffer< Device, int[]> globalRechits
cms::alpakatools::device_buffer< Device, float[]> globalClusterEnergy
cms::alpakatools::device_buffer< Device, reco::pfClustering::Position4[]> globalClusterPos

Member Function Documentation

◆ cluster()

void ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::cluster ( Queue &  queue,
const reco::PFClusterParamsDeviceCollection params,
const reco::PFRecHitHCALTopologyDeviceCollection topology,
reco::PFClusteringVarsDeviceCollection pfClusteringVars,
reco::PFClusteringEdgeVarsDeviceCollection pfClusteringEdgeVars,
const reco::PFRecHitHostCollection pfRecHits,
reco::PFClusterDeviceCollection pfClusters,
reco::PFRecHitFractionDeviceCollection pfrhFractions 
)

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

References ALPAKA_ACCELERATOR_NAMESPACE::blocksForExoticClusters, cms::alpakatools::divide_up_by(), globalClusterEnergy, globalClusterPos, globalPrevClusterPos, globalRechits, globalRhFracSum, globalSeeds, submitPVValidationJobs::params, HLT_2024v14_cff::pfRecHits, createBeamHaloJobs::queue, ALPAKA_ACCELERATOR_NAMESPACE::threadsPerBlockForClustering, and HLT_2024v14_cff::topology.

Referenced by ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::produce().

1538  {
1539  const int nRH = pfRecHits->size();
1540 
1541  // fillRhfIndex
1542  alpaka::exec<Acc2D>(queue,
1543  make_workdiv<Acc2D>({divide_up_by(nRH, 32), divide_up_by(nRH, 32)}, {32, 32}),
1544  FillRhfIndex{},
1545  pfRecHits.view(),
1546  pfClusteringVars.view(),
1547  pfrhFractions.view());
1548 
1549  // Run fastCluster
1550  alpaka::exec<Acc1D>(queue,
1551  make_workdiv<Acc1D>(nRH, threadsPerBlockForClustering),
1552  FastCluster{},
1553  pfRecHits.view(),
1554  params.view(),
1555  topology.view(),
1556  pfClusteringVars.view(),
1557  pfClusters.view(),
1558  pfrhFractions.view());
1559  // exotic clustering kernel
1560  alpaka::exec<Acc1D>(queue,
1561  make_workdiv<Acc1D>(blocksForExoticClusters,
1562  threadsPerBlockForClustering), // uses 4 blocks to minimize memory usage
1563  FastClusterExotic{},
1564  pfRecHits.view(),
1565  params.view(),
1566  topology.view(),
1567  pfClusteringVars.view(),
1568  pfClusters.view(),
1569  pfrhFractions.view(),
1570  globalClusterPos.data(),
1571  globalPrevClusterPos.data(),
1572  globalClusterEnergy.data(),
1573  globalRhFracSum.data(),
1574  globalSeeds.data(),
1575  globalRechits.data());
1576  }
static constexpr uint32_t blocksForExoticClusters
constexpr Idx divide_up_by(Idx value, Idx divisor)
Definition: workdivision.h:20
cms::alpakatools::device_buffer< Device, reco::pfClustering::Position4[]> globalPrevClusterPos
cms::alpakatools::device_buffer< Device, int[]> globalSeeds
cms::alpakatools::device_buffer< Device, float[]> globalRhFracSum
cms::alpakatools::device_buffer< Device, int[]> globalRechits
cms::alpakatools::device_buffer< Device, float[]> globalClusterEnergy
cms::alpakatools::device_buffer< Device, reco::pfClustering::Position4[]> globalClusterPos

◆ seedTopoAndContract()

void ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::seedTopoAndContract ( Queue &  queue,
const reco::PFClusterParamsDeviceCollection params,
const reco::PFRecHitHCALTopologyDeviceCollection topology,
reco::PFClusteringVarsDeviceCollection pfClusteringVars,
reco::PFClusteringEdgeVarsDeviceCollection pfClusteringEdgeVars,
const reco::PFRecHitHostCollection pfRecHits,
reco::PFClusterDeviceCollection pfClusters,
uint32_t *__restrict__  nRHF 
)

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

References gather_cfg::blocks, cms::alpakatools::divide_up_by(), nSeeds, submitPVValidationJobs::params, HLT_2024v14_cff::pfRecHits, createBeamHaloJobs::queue, ALPAKA_ACCELERATOR_NAMESPACE::threadsPerBlockForClustering, and HLT_2024v14_cff::topology.

Referenced by ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::acquire().

1478  {
1479  const int nRH = pfRecHits->size();
1480  const int threadsPerBlock = 256;
1481  const int blocks = divide_up_by(nRH, threadsPerBlock);
1482 
1483  // seedingTopoThresh
1484  alpaka::exec<Acc1D>(queue,
1485  make_workdiv<Acc1D>(blocks, threadsPerBlock),
1486  SeedingTopoThresh{},
1487  pfClusteringVars.view(),
1488  params.view(),
1489  topology.view(),
1490  pfRecHits.view(),
1491  pfClusters.view(),
1492  nSeeds.data());
1493  // prepareTopoInputs
1494  alpaka::exec<Acc1D>(queue,
1495  make_workdiv<Acc1D>(blocks, threadsPerBlock),
1496  PrepareTopoInputs{},
1497  pfRecHits.view(),
1498  pfClusteringVars.view(),
1499  pfClusteringEdgeVars.view(),
1500  nSeeds.data());
1501  // ECLCC
1502  alpaka::exec<Acc1D>(queue,
1503  make_workdiv<Acc1D>(blocks, threadsPerBlock),
1504  ECLCCInit{},
1505  pfRecHits.view(),
1506  pfClusteringVars.view(),
1507  pfClusteringEdgeVars.view());
1508  alpaka::exec<Acc1D>(queue,
1509  make_workdiv<Acc1D>(blocks, threadsPerBlock),
1510  ECLCCCompute1{},
1511  pfRecHits.view(),
1512  pfClusteringVars.view(),
1513  pfClusteringEdgeVars.view());
1514  alpaka::exec<Acc1D>(queue,
1515  make_workdiv<Acc1D>(blocks, threadsPerBlock),
1516  ECLCCFlatten{},
1517  pfRecHits.view(),
1518  pfClusteringVars.view(),
1519  pfClusteringEdgeVars.view());
1520  // topoClusterContraction
1521  alpaka::exec<Acc1D>(queue,
1522  make_workdiv<Acc1D>(1, threadsPerBlockForClustering),
1523  TopoClusterContraction{},
1524  pfRecHits.view(),
1525  pfClusteringVars.view(),
1526  pfClusters.view(),
1527  nSeeds.data(),
1528  nRHF);
1529  }
constexpr Idx divide_up_by(Idx value, Idx divisor)
Definition: workdivision.h:20
cms::alpakatools::device_buffer< Device, uint32_t > nSeeds

Member Data Documentation

◆ globalClusterEnergy

cms::alpakatools::device_buffer<Device, float[]> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::globalClusterEnergy
private

Definition at line 64 of file PFClusterSoAProducerKernel.h.

Referenced by cluster().

◆ globalClusterPos

cms::alpakatools::device_buffer<Device, reco::pfClustering::Position4[]> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::globalClusterPos
private

Definition at line 62 of file PFClusterSoAProducerKernel.h.

Referenced by cluster().

◆ globalPrevClusterPos

cms::alpakatools::device_buffer<Device, reco::pfClustering::Position4[]> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::globalPrevClusterPos
private

Definition at line 63 of file PFClusterSoAProducerKernel.h.

Referenced by cluster().

◆ globalRechits

cms::alpakatools::device_buffer<Device, int[]> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::globalRechits
private

Definition at line 67 of file PFClusterSoAProducerKernel.h.

Referenced by cluster().

◆ globalRhFracSum

cms::alpakatools::device_buffer<Device, float[]> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::globalRhFracSum
private

Definition at line 65 of file PFClusterSoAProducerKernel.h.

Referenced by cluster().

◆ globalSeeds

cms::alpakatools::device_buffer<Device, int[]> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::globalSeeds
private

Definition at line 66 of file PFClusterSoAProducerKernel.h.

Referenced by cluster().

◆ nSeeds

cms::alpakatools::device_buffer<Device, uint32_t> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::nSeeds
private

Definition at line 61 of file PFClusterSoAProducerKernel.h.

Referenced by PFClusterProducerKernel(), and seedTopoAndContract().