CMS 3D CMS Logo

HGCalLayerClustersAlgoWrapper.dev.cc
Go to the documentation of this file.
1 // Check that ALPAKA_HOST_ONLY is not defined during device compilation:
2 #ifdef ALPAKA_HOST_ONLY
3 #error ALPAKA_HOST_ONLY defined in device compilation
4 #endif
5 
7 
9 #include "ConstantsForClusters.h"
10 
11 #include "CLUEAlgoAlpaka.h"
12 
14 
15  using namespace cms::alpakatools;
16  using namespace hgcal::constants;
17 
19  const unsigned int size,
20  const float dc,
21  const float kappa,
22  const float outlierDeltaFactor,
23  const HGCalSoARecHitsDeviceCollection::ConstView inputs,
25  CLUEAlgoAlpaka<ALPAKA_ACCELERATOR_NAMESPACE::Acc1D, Queue, HGCalSiliconTilesConstants, kHGCalLayers> algoStandalone(
26  queue, dc, kappa, outlierDeltaFactor, false);
27 
28  // Initialize output memory to 0
29  auto delta = cms::alpakatools::make_device_view<float>(alpaka::getDev(queue), outputs.delta(), size);
30  alpaka::memset(queue, delta, 0x0);
31  auto rho = cms::alpakatools::make_device_view<float>(alpaka::getDev(queue), outputs.rho(), size);
32  alpaka::memset(queue, rho, 0x0);
33  auto nearestHigher =
34  cms::alpakatools::make_device_view<unsigned int>(alpaka::getDev(queue), outputs.nearestHigher(), size);
35  alpaka::memset(queue, nearestHigher, 0x0);
36  auto clusterIndex = cms::alpakatools::make_device_view<int>(alpaka::getDev(queue), outputs.clusterIndex(), size);
37  alpaka::memset(queue, clusterIndex, kInvalidClusterByte);
38  auto isSeed = cms::alpakatools::make_device_view<uint8_t>(alpaka::getDev(queue), outputs.isSeed(), size);
39  alpaka::memset(queue, isSeed, 0x0);
40 
41  algoStandalone.makeClustersCMSSW(size,
42  inputs.dim1(),
43  inputs.dim2(),
44  inputs.layer(),
45  inputs.weight(),
46  inputs.sigmaNoise(),
47  inputs.detid(),
48  outputs.rho(),
49  outputs.delta(),
50  outputs.nearestHigher(),
51  outputs.clusterIndex(),
52  outputs.isSeed(),
53  &outputs.numberOfClustersScalar());
54  }
55 
56 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
void run(Queue &queue, const unsigned int size, const float dc, const float kappa, const float outlierDeltaFactor, const HGCalSoARecHitsDeviceCollection::ConstView inputs, HGCalSoARecHitsExtraDeviceCollection::View outputs) const
static constexpr uint8_t kInvalidClusterByte