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 
11 
12 #include "CAPixelDoubletsAlgos.h"
13 
15  using namespace alpaka;
16  using namespace cms::alpakatools;
17  namespace caPixelDoublets {
18 
19  template <typename TrackerTraits>
20  class InitDoublets {
21  public:
22  template <typename TAcc, typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
23  ALPAKA_FN_ACC void operator()(TAcc const& acc,
25  int nHits,
30  ALPAKA_ASSERT_ACC((*isOuterHitOfCell).container);
31 
32  for (auto i : cms::alpakatools::uniform_elements(acc, nHits - isOuterHitOfCell->offset))
33  (*isOuterHitOfCell).container[i].reset();
34 
36  cellNeighbors->construct(TrackerTraits::maxNumOfActiveDoublets, cellNeighborsContainer);
37  cellTracks->construct(TrackerTraits::maxNumOfActiveDoublets, cellTracksContainer);
38  [[maybe_unused]] auto i = cellNeighbors->extend(acc);
39  ALPAKA_ASSERT_ACC(0 == i);
40  (*cellNeighbors)[0].reset();
41  i = cellTracks->extend(acc);
42  ALPAKA_ASSERT_ACC(0 == i);
43  (*cellTracks)[0].reset();
44  }
45  }
46  };
47 
48  // Not used for the moment, see below.
49  //constexpr auto getDoubletsFromHistoMaxBlockSize = 64; // for both x and y
50  //constexpr auto getDoubletsFromHistoMinBlocksPerMP = 16;
51 
52  template <typename TrackerTraits>
54  public:
55  template <typename TAcc, typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
56  // #ifdef __CUDACC__
57  // __launch_bounds__(getDoubletsFromHistoMaxBlockSize, getDoubletsFromHistoMinBlocksPerMP) // TODO: Alapakify
58  // #endif
59  ALPAKA_FN_ACC void operator()(TAcc const& acc,
61  uint32_t* nCells,
66  uint32_t nActualPairs,
67  const uint32_t maxNumOfDoublets,
69  doubletsFromHisto<TrackerTraits>(
71  }
72  };
73 
74  } // namespace caPixelDoublets
75 
76 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
77 
78 #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:34
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