7 #include <alpaka/alpaka.hpp> 29 template <
typename TrackerTraits>
32 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
34 uint32_t
const* __restrict__ hitsModuleStart,
36 uint32_t* __restrict__ hitsLayerStart)
const {
40 hitsLayerStart[
i] = hitsModuleStart[cpeParams->
layerGeometry().layerStart[
i]];
42 int old =
i == 0 ? 0 : hitsModuleStart[cpeParams->
layerGeometry().layerStart[
i - 1]];
43 printf(
"LayerStart %d/%d at module %d: %d - %d\n",
48 hitsLayerStart[
i] - old);
56 template <
typename TrackerTraits>
64 auto nHits = clusters_d.nClusters();
65 auto offsetBPIX2 = clusters_d.offsetBPIX2();
69 int activeModulesWithDigis = digis_d.nModules();
72 if (activeModulesWithDigis) {
73 int threadsPerBlock = 128;
75 int blocks = activeModulesWithDigis;
76 const auto workDiv1D = cms::alpakatools::make_workdiv<Acc1D>(
blocks, threadsPerBlock);
79 std::cout <<
"launching GetHits kernel on " << alpaka::core::demangled<Acc1D> <<
" with " <<
blocks <<
" blocks" 82 alpaka::exec<Acc1D>(
queue,
84 GetHits<TrackerTraits>{},
98 const auto workDiv1D = cms::alpakatools::make_workdiv<Acc1D>(1, 32);
99 alpaka::exec<Acc1D>(
queue,
102 clusters_d->clusModuleStart(),
104 hits_d.view().hitsLayerStart().data());
110 hrv_d.assoc = &(hits_d.view().phiBinner());
112 hrv_d.offStorage =
nullptr;
113 hrv_d.contentSize =
nHits;
114 hrv_d.contentStorage = hits_d.view().phiBinnerStorage();
116 cms::alpakatools::fillManyFromVector<Acc1D>(&(hits_d.view().phiBinner()),
119 hits_d.view().iphi(),
120 hits_d.view().hitsLayerStart().data(),
133 std::cout <<
"PixelRecHitKernel -> DONE!" << std::endl;
ALPAKA_FN_ACC void operator()(TAcc const &acc, uint32_t const *__restrict__ hitsModuleStart, pixelCPEforDevice::ParamsOnDeviceT< TrackerTraits > const *__restrict__ cpeParams, uint32_t *__restrict__ hitsLayerStart) const
typename PhiBinner::View PhiBinnerView
constexpr uint32_t numberOfLayers
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, SiPixelDigisHost, SiPixelDigisDevice< Device > > SiPixelDigisSoACollection
constexpr LayerGeometry const &__restrict__ layerGeometry() const
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, TrackingRecHitHost< TrackerTraits >, TrackingRecHitDevice< TrackerTraits, Device > > TrackingRecHitsSoACollection
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
ALPAKA_ASSERT_ACC(offsets)
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, SiPixelClustersHost, SiPixelClustersDevice< Device > > SiPixelClustersSoACollection