CMS 3D CMS Logo

CAPixelDoublets.h
Go to the documentation of this file.
1 #ifndef RecoPixelVertexing_PixelTriplets_alpaka_CAPixelDoublets_h
2 #define RecoPixelVertexing_PixelTriplets_alpaka_CAPixelDoublets_h
3 
4 #include <alpaka/alpaka.hpp>
5 
8 #include "CAPixelDoubletsAlgos.h"
9 
11  using namespace alpaka;
12  using namespace cms::alpakatools;
13  namespace caPixelDoublets {
14 
15  template <typename TrackerTraits>
16  class InitDoublets {
17  public:
18  template <typename TAcc, typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
19  ALPAKA_FN_ACC void operator()(TAcc const& acc,
21  int nHits,
26  ALPAKA_ASSERT_OFFLOAD((*isOuterHitOfCell).container);
27 
29  (*isOuterHitOfCell).container[i].reset();
30 
32  cellNeighbors->construct(TrackerTraits::maxNumOfActiveDoublets, cellNeighborsContainer);
33  cellTracks->construct(TrackerTraits::maxNumOfActiveDoublets, cellTracksContainer);
34  [[maybe_unused]] auto i = cellNeighbors->extend(acc);
36  (*cellNeighbors)[0].reset();
37  i = cellTracks->extend(acc);
39  (*cellTracks)[0].reset();
40  }
41  }
42  };
43 
44  // Not used for the moment, see below.
45  //constexpr auto getDoubletsFromHistoMaxBlockSize = 64; // for both x and y
46  //constexpr auto getDoubletsFromHistoMinBlocksPerMP = 16;
47 
48  template <typename TrackerTraits>
50  public:
51  template <typename TAcc, typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
52  // #ifdef __CUDACC__
53  // __launch_bounds__(getDoubletsFromHistoMaxBlockSize, getDoubletsFromHistoMinBlocksPerMP) // TODO: Alapakify
54  // #endif
55  ALPAKA_FN_ACC void operator()(TAcc const& acc,
57  uint32_t* nCells,
62  uint32_t nActualPairs,
63  const uint32_t maxNumOfDoublets,
65  doubletsFromHisto<TrackerTraits>(
67  }
68  };
69  } // namespace caPixelDoublets
70 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
71 #endif // RecoPixelVertexing_PixelTriplets_plugins_CAPixelDoublets_h
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)
Definition: workdivision.h:793
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