CMS 3D CMS Logo

CAPixelDoublets.h
Go to the documentation of this file.
1 #ifndef RecoTracker_PixelSeeding_plugins_alpaka_CAPixelDoublets_h
2 #define RecoTracker_PixelSeeding_plugins_alpaka_CAPixelDoublets_h
3 
4 #include <type_traits>
5 
6 #include <alpaka/alpaka.hpp>
7 
10 
11 #include "CAPixelDoubletsAlgos.h"
12 
14  using namespace alpaka;
15  using namespace cms::alpakatools;
16  namespace caPixelDoublets {
17 
18  template <typename TrackerTraits>
19  class InitDoublets {
20  public:
21  template <typename TAcc, typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
22  ALPAKA_FN_ACC void operator()(TAcc const& acc,
24  int nHits,
29  ALPAKA_ASSERT_ACC((*isOuterHitOfCell).container);
30 
31  for (auto i : cms::alpakatools::uniform_elements(acc, nHits - isOuterHitOfCell->offset))
32  (*isOuterHitOfCell).container[i].reset();
33 
35  cellNeighbors->construct(TrackerTraits::maxNumOfActiveDoublets, cellNeighborsContainer);
36  cellTracks->construct(TrackerTraits::maxNumOfActiveDoublets, cellTracksContainer);
37  [[maybe_unused]] auto i = cellNeighbors->extend(acc);
38  ALPAKA_ASSERT_ACC(0 == i);
39  (*cellNeighbors)[0].reset();
40  i = cellTracks->extend(acc);
41  ALPAKA_ASSERT_ACC(0 == i);
42  (*cellTracks)[0].reset();
43  }
44  }
45  };
46 
47  // Not used for the moment, see below.
48  //constexpr auto getDoubletsFromHistoMaxBlockSize = 64; // for both x and y
49  //constexpr auto getDoubletsFromHistoMinBlocksPerMP = 16;
50 
51  template <typename TrackerTraits>
53  public:
54  template <typename TAcc, typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
55  // #ifdef __CUDACC__
56  // __launch_bounds__(getDoubletsFromHistoMaxBlockSize, getDoubletsFromHistoMinBlocksPerMP) // TODO: Alapakify
57  // #endif
58  ALPAKA_FN_ACC void operator()(TAcc const& acc,
60  uint32_t* nCells,
65  uint32_t nActualPairs,
66  const uint32_t maxNumOfDoublets,
68  doubletsFromHisto<TrackerTraits>(
70  }
71  };
72 
73  } // namespace caPixelDoublets
74 
75 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
76 
77 #endif // RecoTracker_PixelSeeding_plugins_alpaka_CAPixelDoublets_h
ALPAKA_FN_ACC auto uniform_elements(TAcc const &acc, TArgs... args)
Definition: workdivision.h:311
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t CellNeighborsVector< TrackerTraits > * cellNeighbors
int CellNeighborsVector< TrackerTraits > CellNeighbors< TrackerTraits > * cellNeighborsContainer
uint32_t CellNeighborsVector< TrackerTraits > CellTracksVector< TrackerTraits > HitsConstView< TrackerTraits > OuterHitOfCell< TrackerTraits > int nActualPairs
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t CellNeighborsVector< TrackerTraits > CellTracksVector< TrackerTraits > HitsConstView< TrackerTraits > hh
typename CACellT< TrackerTraits >::HitsConstView HitsConstView
Definition: CAFishbone.h:33
ALPAKA_FN_ACC void operator()(TAcc const &acc, CACellT< TrackerTraits > *cells, uint32_t *nCells, CellNeighborsVector< TrackerTraits > *cellNeighbors, CellTracksVector< TrackerTraits > *cellTracks, HitsConstView< TrackerTraits > hh, OuterHitOfCell< TrackerTraits > *isOuterHitOfCell, uint32_t nActualPairs, const uint32_t maxNumOfDoublets, CellCutsT< TrackerTraits > cuts) const
ALPAKA_FN_ACC void operator()(TAcc const &acc, OuterHitOfCell< TrackerTraits > *isOuterHitOfCell, int nHits, CellNeighborsVector< TrackerTraits > *cellNeighbors, CellNeighbors< TrackerTraits > *cellNeighborsContainer, CellTracksVector< TrackerTraits > *cellTracks, CellTracks< TrackerTraits > *cellTracksContainer) const
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t maxNumOfDoublets
int CellNeighborsVector< TrackerTraits > CellNeighbors< TrackerTraits > CellTracksVector< TrackerTraits > CellTracks< TrackerTraits > * cellTracksContainer
ALPAKA_FN_ACC constexpr bool once_per_grid(TAcc const &acc)
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t * nCells
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t CellNeighborsVector< TrackerTraits > CellTracksVector< TrackerTraits > * cellTracks
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
ALPAKA_FN_ACC ALPAKA_FN_INLINE void uint32_t const uint32_t CACellT< TrackerTraits > uint32_t CellNeighborsVector< TrackerTraits > CellTracksVector< TrackerTraits > HitsConstView< TrackerTraits > OuterHitOfCell< TrackerTraits > isOuterHitOfCell