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 execute (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)
 

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

References nSeeds, and createBeamHaloJobs::queue.

1457  : nSeeds(cms::alpakatools::make_device_buffer<uint32_t>(queue)),
1467  alpaka::memset(queue, nSeeds, 0x00); // Reset nSeeds
1468  }
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

◆ execute()

void ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::execute ( 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 1470 of file PFClusterSoAProducerKernel.dev.cc.

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

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

1477  {
1478  const int nRH = pfRecHits->size();
1479  const int threadsPerBlock = 256;
1480  const int blocks = divide_up_by(nRH, threadsPerBlock);
1481 
1482  // seedingTopoThresh
1483  alpaka::exec<Acc1D>(queue,
1484  make_workdiv<Acc1D>(blocks, threadsPerBlock),
1485  SeedingTopoThresh{},
1486  pfClusteringVars.view(),
1487  params.view(),
1488  topology.view(),
1489  pfRecHits.view(),
1490  pfClusters.view(),
1491  pfrhFractions.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 
1529  // fillRhfIndex
1530  alpaka::exec<Acc2D>(queue,
1531  make_workdiv<Acc2D>({divide_up_by(nRH, 32), divide_up_by(nRH, 32)}, {32, 32}),
1532  FillRhfIndex{},
1533  pfRecHits.view(),
1534  pfClusteringVars.view(),
1535  pfrhFractions.view());
1536 
1537  // Run fastCluster
1538  alpaka::exec<Acc1D>(queue,
1539  make_workdiv<Acc1D>(nRH, threadsPerBlockForClustering),
1540  FastCluster{},
1541  pfRecHits.view(),
1542  params.view(),
1543  topology.view(),
1544  pfClusteringVars.view(),
1545  pfClusters.view(),
1546  pfrhFractions.view());
1547  // exotic clustering kernel
1548  alpaka::exec<Acc1D>(queue,
1549  make_workdiv<Acc1D>(blocksForExoticClusters,
1550  threadsPerBlockForClustering), // uses 4 blocks to minimize memory usage
1551  FastClusterExotic{},
1552  pfRecHits.view(),
1553  params.view(),
1554  topology.view(),
1555  pfClusteringVars.view(),
1556  pfClusters.view(),
1557  pfrhFractions.view(),
1558  globalClusterPos.data(),
1559  globalPrevClusterPos.data(),
1560  globalClusterEnergy.data(),
1561  globalRhFracSum.data(),
1562  globalSeeds.data(),
1563  globalRechits.data());
1564  }
static constexpr uint32_t blocksForExoticClusters
constexpr Idx divide_up_by(Idx value, Idx divisor)
Definition: workdivision.h:20
cms::alpakatools::device_buffer< Device, uint32_t > nSeeds
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 Data Documentation

◆ globalClusterEnergy

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

Definition at line 55 of file PFClusterSoAProducerKernel.h.

Referenced by execute().

◆ globalClusterPos

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

Definition at line 53 of file PFClusterSoAProducerKernel.h.

Referenced by execute().

◆ globalPrevClusterPos

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

Definition at line 54 of file PFClusterSoAProducerKernel.h.

Referenced by execute().

◆ globalRechits

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

Definition at line 58 of file PFClusterSoAProducerKernel.h.

Referenced by execute().

◆ globalRhFracSum

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

Definition at line 56 of file PFClusterSoAProducerKernel.h.

Referenced by execute().

◆ globalSeeds

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

Definition at line 57 of file PFClusterSoAProducerKernel.h.

Referenced by execute().

◆ nSeeds

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

Definition at line 52 of file PFClusterSoAProducerKernel.h.

Referenced by execute(), and PFClusterProducerKernel().