CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes | Static Private Attributes
TrackingRecHit2DHeterogeneous< Traits > Class Template Reference

#include <TrackingRecHit2DHeterogeneous.h>

Public Types

using PhiBinner = TrackingRecHit2DSOAView::PhiBinner
 
template<typename T >
using unique_ptr = typename Traits::template unique_ptr< T >
 

Public Member Functions

auto hitsLayerStart ()
 
auto hitsModuleStart () const
 
cms::cuda::host::unique_ptr< uint32_t[]> hitsModuleStartToHostAsync (cudaStream_t stream) const
 
auto iphi ()
 
cms::cuda::host::unique_ptr< float[]> localCoordToHostAsync (cudaStream_t stream) const
 
auto nHits () const
 
TrackingRecHit2DHeterogeneousoperator= (const TrackingRecHit2DHeterogeneous &)=delete
 
TrackingRecHit2DHeterogeneousoperator= (TrackingRecHit2DHeterogeneous &&)=default
 
auto phiBinner ()
 
 TrackingRecHit2DHeterogeneous ()=default
 
 TrackingRecHit2DHeterogeneous (const TrackingRecHit2DHeterogeneous &)=delete
 
 TrackingRecHit2DHeterogeneous (TrackingRecHit2DHeterogeneous &&)=default
 
 TrackingRecHit2DHeterogeneous (uint32_t nHits, pixelCPEforGPU::ParamsOnGPU const *cpeParams, uint32_t const *hitsModuleStart, cudaStream_t stream)
 
TrackingRecHit2DSOAViewview ()
 
TrackingRecHit2DSOAView const * view () const
 
 ~TrackingRecHit2DHeterogeneous ()=default
 

Private Attributes

unique_ptr< TrackingRecHit2DSOAView::AverageGeometrym_AverageGeometryStore
 
uint32_t * m_hitsLayerStart
 
uint32_t const * m_hitsModuleStart
 
int16_t * m_iphi
 
uint32_t m_nHits
 
PhiBinnerm_phiBinner
 
unique_ptr< TrackingRecHit2DSOAView::PhiBinnerm_PhiBinnerStore
 
unique_ptr< uint16_t[]> m_store16
 
unique_ptr< float[]> m_store32
 
unique_ptr< TrackingRecHit2DSOAViewm_view
 

Static Private Attributes

static constexpr uint32_t n16 = 4
 
static constexpr uint32_t n32 = 9
 

Detailed Description

template<typename Traits>
class TrackingRecHit2DHeterogeneous< Traits >

Definition at line 8 of file TrackingRecHit2DHeterogeneous.h.

Member Typedef Documentation

◆ PhiBinner

template<typename Traits >
using TrackingRecHit2DHeterogeneous< Traits >::PhiBinner = TrackingRecHit2DSOAView::PhiBinner

Definition at line 13 of file TrackingRecHit2DHeterogeneous.h.

◆ unique_ptr

template<typename Traits >
template<typename T >
using TrackingRecHit2DHeterogeneous< Traits >::unique_ptr = typename Traits::template unique_ptr<T>

Definition at line 11 of file TrackingRecHit2DHeterogeneous.h.

Constructor & Destructor Documentation

◆ TrackingRecHit2DHeterogeneous() [1/4]

template<typename Traits >
TrackingRecHit2DHeterogeneous< Traits >::TrackingRecHit2DHeterogeneous ( )
default

◆ TrackingRecHit2DHeterogeneous() [2/4]

template<typename Traits >
TrackingRecHit2DHeterogeneous< Traits >::TrackingRecHit2DHeterogeneous ( uint32_t  nHits,
pixelCPEforGPU::ParamsOnGPU const *  cpeParams,
uint32_t const *  hitsModuleStart,
cudaStream_t  stream 
)
explicit

Definition at line 70 of file TrackingRecHit2DHeterogeneous.h.

75  auto view = Traits::template make_host_unique<TrackingRecHit2DSOAView>(stream);
76 
77  view->m_nHits = nHits;
78  m_view = Traits::template make_device_unique<TrackingRecHit2DSOAView>(stream);
79  m_AverageGeometryStore = Traits::template make_device_unique<TrackingRecHit2DSOAView::AverageGeometry>(stream);
81  view->m_cpeParams = cpeParams;
83 
84  // if empy do not bother
85  if (0 == nHits) {
88  } else {
89  m_view.reset(view.release()); // NOLINT: std::move() breaks CUDA version
90  }
91  return;
92  }
93 
94  // the single arrays are not 128 bit alligned...
95  // the hits are actually accessed in order only in building
96  // if ordering is relevant they may have to be stored phi-ordered by layer or so
97  // this will break 1to1 correspondence with cluster and module locality
98  // so unless proven VERY inefficient we keep it ordered as generated
99  m_store16 = Traits::template make_device_unique<uint16_t[]>(nHits * n16, stream);
100  m_store32 = Traits::template make_device_unique<float[]>(nHits * n32 + 11, stream);
101  m_PhiBinnerStore = Traits::template make_device_unique<TrackingRecHit2DSOAView::PhiBinner>(stream);
102 
103  auto get16 = [&](int i) { return m_store16.get() + i * nHits; };
104  auto get32 = [&](int i) { return m_store32.get() + i * nHits; };
105 
106  // copy all the pointers
108 
109  view->m_xl = get32(0);
110  view->m_yl = get32(1);
111  view->m_xerr = get32(2);
112  view->m_yerr = get32(3);
113 
114  view->m_xg = get32(4);
115  view->m_yg = get32(5);
116  view->m_zg = get32(6);
117  view->m_rg = get32(7);
118 
119  m_iphi = view->m_iphi = reinterpret_cast<int16_t*>(get16(0));
120 
121  view->m_charge = reinterpret_cast<int32_t*>(get32(8));
122  view->m_xsize = reinterpret_cast<int16_t*>(get16(2));
123  view->m_ysize = reinterpret_cast<int16_t*>(get16(3));
124  view->m_detInd = get16(1);
125 
126  m_hitsLayerStart = view->m_hitsLayerStart = reinterpret_cast<uint32_t*>(get32(n32));
127 
128  // transfer view
131  } else {
132  m_view.reset(view.release()); // NOLINT: std::move() breaks CUDA version
133  }
134 }

References cms::cuda::copyAsync(), TrackingRecHit2DHeterogeneous< Traits >::hitsModuleStart(), mps_fire::i, TrackingRecHit2DSOAView::m_averageGeometry, TrackingRecHit2DHeterogeneous< Traits >::m_AverageGeometryStore, TrackingRecHit2DSOAView::m_charge, TrackingRecHit2DSOAView::m_cpeParams, TrackingRecHit2DSOAView::m_detInd, TrackingRecHit2DHeterogeneous< Traits >::m_hitsLayerStart, TrackingRecHit2DSOAView::m_hitsLayerStart, TrackingRecHit2DSOAView::m_hitsModuleStart, TrackingRecHit2DHeterogeneous< Traits >::m_iphi, TrackingRecHit2DSOAView::m_iphi, TrackingRecHit2DSOAView::m_nHits, TrackingRecHit2DHeterogeneous< Traits >::m_phiBinner, TrackingRecHit2DSOAView::m_phiBinner, TrackingRecHit2DHeterogeneous< Traits >::m_PhiBinnerStore, TrackingRecHit2DSOAView::m_rg, TrackingRecHit2DHeterogeneous< Traits >::m_store16, TrackingRecHit2DHeterogeneous< Traits >::m_store32, TrackingRecHit2DHeterogeneous< Traits >::m_view, TrackingRecHit2DSOAView::m_xerr, TrackingRecHit2DSOAView::m_xg, TrackingRecHit2DSOAView::m_xl, TrackingRecHit2DSOAView::m_xsize, TrackingRecHit2DSOAView::m_yerr, TrackingRecHit2DSOAView::m_yg, TrackingRecHit2DSOAView::m_yl, TrackingRecHit2DSOAView::m_ysize, TrackingRecHit2DSOAView::m_zg, TrackingRecHit2DHeterogeneous< Traits >::n16, TrackingRecHit2DHeterogeneous< Traits >::n32, TrackingRecHit2DHeterogeneous< Traits >::nHits(), cms::cuda::stream, svgfig::template(), relativeConstraints::value, and TrackingRecHit2DHeterogeneous< Traits >::view().

◆ ~TrackingRecHit2DHeterogeneous()

template<typename Traits >
TrackingRecHit2DHeterogeneous< Traits >::~TrackingRecHit2DHeterogeneous ( )
default

◆ TrackingRecHit2DHeterogeneous() [3/4]

template<typename Traits >
TrackingRecHit2DHeterogeneous< Traits >::TrackingRecHit2DHeterogeneous ( const TrackingRecHit2DHeterogeneous< Traits > &  )
delete

◆ TrackingRecHit2DHeterogeneous() [4/4]

template<typename Traits >
TrackingRecHit2DHeterogeneous< Traits >::TrackingRecHit2DHeterogeneous ( TrackingRecHit2DHeterogeneous< Traits > &&  )
default

Member Function Documentation

◆ hitsLayerStart()

template<typename Traits >
auto TrackingRecHit2DHeterogeneous< Traits >::hitsLayerStart ( )
inline

◆ hitsModuleStart()

template<typename Traits >
auto TrackingRecHit2DHeterogeneous< Traits >::hitsModuleStart ( ) const
inline

◆ hitsModuleStartToHostAsync()

cms::cuda::host::unique_ptr< uint32_t[]> TrackingRecHit2DCUDA::hitsModuleStartToHostAsync ( cudaStream_t  stream) const

Definition at line 15 of file TrackingRecHit2DHeterogeneous.cc.

15  {
16  auto ret = cms::cuda::make_host_unique<uint32_t[]>(gpuClustering::maxNumModules + 1, stream);
17  cudaCheck(cudaMemcpyAsync(
18  ret.get(), m_hitsModuleStart, sizeof(uint32_t) * (gpuClustering::maxNumModules + 1), cudaMemcpyDefault, stream));
19  return ret;
20 }

References cudaCheck, TrackingRecHit2DHeterogeneous< Traits >::m_hitsModuleStart, gpuClustering::maxNumModules, runTheMatrix::ret, and cms::cuda::stream.

◆ iphi()

template<typename Traits >
auto TrackingRecHit2DHeterogeneous< Traits >::iphi ( )
inline

Definition at line 37 of file TrackingRecHit2DHeterogeneous.h.

37 { return m_iphi; }

References TrackingRecHit2DHeterogeneous< Traits >::m_iphi.

◆ localCoordToHostAsync()

cms::cuda::host::unique_ptr< float[]> TrackingRecHit2DCUDA::localCoordToHostAsync ( cudaStream_t  stream) const

◆ nHits()

template<typename Traits >
auto TrackingRecHit2DHeterogeneous< Traits >::nHits ( ) const
inline

◆ operator=() [1/2]

template<typename Traits >
TrackingRecHit2DHeterogeneous& TrackingRecHit2DHeterogeneous< Traits >::operator= ( const TrackingRecHit2DHeterogeneous< Traits > &  )
delete

◆ operator=() [2/2]

template<typename Traits >
TrackingRecHit2DHeterogeneous& TrackingRecHit2DHeterogeneous< Traits >::operator= ( TrackingRecHit2DHeterogeneous< Traits > &&  )
default

◆ phiBinner()

template<typename Traits >
auto TrackingRecHit2DHeterogeneous< Traits >::phiBinner ( )
inline

◆ view() [1/2]

template<typename Traits >
TrackingRecHit2DSOAView* TrackingRecHit2DHeterogeneous< Traits >::view ( )
inline

◆ view() [2/2]

template<typename Traits >
TrackingRecHit2DSOAView const* TrackingRecHit2DHeterogeneous< Traits >::view ( ) const
inline

Definition at line 30 of file TrackingRecHit2DHeterogeneous.h.

30 { return m_view.get(); }

References TrackingRecHit2DHeterogeneous< Traits >::m_view.

Member Data Documentation

◆ m_AverageGeometryStore

template<typename Traits >
unique_ptr<TrackingRecHit2DSOAView::AverageGeometry> TrackingRecHit2DHeterogeneous< Traits >::m_AverageGeometryStore
private

◆ m_hitsLayerStart

template<typename Traits >
uint32_t* TrackingRecHit2DHeterogeneous< Traits >::m_hitsLayerStart
private

◆ m_hitsModuleStart

template<typename Traits >
uint32_t const* TrackingRecHit2DHeterogeneous< Traits >::m_hitsModuleStart
private

◆ m_iphi

template<typename Traits >
int16_t* TrackingRecHit2DHeterogeneous< Traits >::m_iphi
private

◆ m_nHits

template<typename Traits >
uint32_t TrackingRecHit2DHeterogeneous< Traits >::m_nHits
private

◆ m_phiBinner

template<typename Traits >
PhiBinner* TrackingRecHit2DHeterogeneous< Traits >::m_phiBinner
private

◆ m_PhiBinnerStore

template<typename Traits >
unique_ptr<TrackingRecHit2DSOAView::PhiBinner> TrackingRecHit2DHeterogeneous< Traits >::m_PhiBinnerStore
private

◆ m_store16

template<typename Traits >
unique_ptr<uint16_t[]> TrackingRecHit2DHeterogeneous< Traits >::m_store16
private

◆ m_store32

template<typename Traits >
unique_ptr<float[]> TrackingRecHit2DHeterogeneous< Traits >::m_store32
private

◆ m_view

template<typename Traits >
unique_ptr<TrackingRecHit2DSOAView> TrackingRecHit2DHeterogeneous< Traits >::m_view
private

◆ n16

template<typename Traits >
constexpr uint32_t TrackingRecHit2DHeterogeneous< Traits >::n16 = 4
staticconstexprprivate

◆ n32

template<typename Traits >
constexpr uint32_t TrackingRecHit2DHeterogeneous< Traits >::n32 = 9
staticconstexprprivate
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
TrackingRecHit2DSOAView::m_iphi
int16_t * m_iphi
Definition: TrackingRecHit2DSOAView.h:81
TrackingRecHit2DHeterogeneous::view
TrackingRecHit2DSOAView * view()
Definition: TrackingRecHit2DHeterogeneous.h:29
TrackingRecHit2DHeterogeneous::m_iphi
int16_t * m_iphi
Definition: TrackingRecHit2DHeterogeneous.h:63
TrackingRecHit2DSOAView::m_yg
float * m_yg
Definition: TrackingRecHit2DSOAView.h:80
TrackingRecHit2DSOAView::m_hitsLayerStart
uint32_t * m_hitsLayerStart
Definition: TrackingRecHit2DSOAView.h:95
TrackingRecHit2DSOAView::m_xerr
float * m_xerr
Definition: TrackingRecHit2DSOAView.h:77
mps_fire.i
i
Definition: mps_fire.py:428
TrackingRecHit2DHeterogeneous::m_view
unique_ptr< TrackingRecHit2DSOAView > m_view
Definition: TrackingRecHit2DHeterogeneous.h:54
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
TrackingRecHit2DSOAView::m_xl
float * m_xl
Definition: TrackingRecHit2DSOAView.h:76
TrackingRecHit2DSOAView::m_nHits
uint32_t m_nHits
Definition: TrackingRecHit2DSOAView.h:99
TrackingRecHit2DHeterogeneous::n16
static constexpr uint32_t n16
Definition: TrackingRecHit2DHeterogeneous.h:44
TrackingRecHit2DSOAView::m_charge
int32_t * m_charge
Definition: TrackingRecHit2DSOAView.h:84
TrackingRecHit2DSOAView::m_ysize
int16_t * m_ysize
Definition: TrackingRecHit2DSOAView.h:86
TrackingRecHit2DHeterogeneous::m_hitsModuleStart
uint32_t const * m_hitsModuleStart
Definition: TrackingRecHit2DHeterogeneous.h:58
gpuClustering::maxNumModules
constexpr uint16_t maxNumModules
Definition: gpuClusteringConstants.h:29
TrackingRecHit2DHeterogeneous::m_phiBinner
PhiBinner * m_phiBinner
Definition: TrackingRecHit2DHeterogeneous.h:61
TrackingRecHit2DHeterogeneous::m_store16
unique_ptr< uint16_t[]> m_store16
Definition: TrackingRecHit2DHeterogeneous.h:46
TrackingRecHit2DHeterogeneous::n32
static constexpr uint32_t n32
Definition: TrackingRecHit2DHeterogeneous.h:45
TrackingRecHit2DSOAView::m_averageGeometry
AverageGeometry * m_averageGeometry
Definition: TrackingRecHit2DSOAView.h:91
TrackingRecHit2DHeterogeneous::hitsModuleStart
auto hitsModuleStart() const
Definition: TrackingRecHit2DHeterogeneous.h:34
TrackingRecHit2DSOAView::m_cpeParams
pixelCPEforGPU::ParamsOnGPU const * m_cpeParams
Definition: TrackingRecHit2DSOAView.h:92
TrackingRecHit2DSOAView::m_yerr
float * m_yerr
Definition: TrackingRecHit2DSOAView.h:77
TrackingRecHit2DHeterogeneous::nHits
auto nHits() const
Definition: TrackingRecHit2DHeterogeneous.h:32
svgfig.template
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
TrackingRecHit2DHeterogeneous::m_AverageGeometryStore
unique_ptr< TrackingRecHit2DSOAView::AverageGeometry > m_AverageGeometryStore
Definition: TrackingRecHit2DHeterogeneous.h:52
TrackingRecHit2DSOAView::m_phiBinner
PhiBinner * m_phiBinner
Definition: TrackingRecHit2DSOAView.h:97
cudaCheck
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:62
TrackingRecHit2DHeterogeneous::m_store32
unique_ptr< float[]> m_store32
Definition: TrackingRecHit2DHeterogeneous.h:49
relativeConstraints.value
value
Definition: relativeConstraints.py:53
TrackingRecHit2DSOAView::m_yl
float * m_yl
Definition: TrackingRecHit2DSOAView.h:76
TrackingRecHit2DHeterogeneous::m_PhiBinnerStore
unique_ptr< TrackingRecHit2DSOAView::PhiBinner > m_PhiBinnerStore
Definition: TrackingRecHit2DHeterogeneous.h:51
TrackingRecHit2DSOAView::m_xg
float * m_xg
Definition: TrackingRecHit2DSOAView.h:80
TrackingRecHit2DSOAView::m_xsize
int16_t * m_xsize
Definition: TrackingRecHit2DSOAView.h:85
TrackingRecHit2DSOAView::m_detInd
uint16_t * m_detInd
Definition: TrackingRecHit2DSOAView.h:87
TrackingRecHit2DHeterogeneous::m_hitsLayerStart
uint32_t * m_hitsLayerStart
Definition: TrackingRecHit2DHeterogeneous.h:62
TrackingRecHit2DHeterogeneous::m_nHits
uint32_t m_nHits
Definition: TrackingRecHit2DHeterogeneous.h:56
TrackingRecHit2DSOAView::m_hitsModuleStart
uint32_t const * m_hitsModuleStart
Definition: TrackingRecHit2DSOAView.h:93
TrackingRecHit2DSOAView::m_rg
float * m_rg
Definition: TrackingRecHit2DSOAView.h:80
TrackingRecHit2DSOAView::m_zg
float * m_zg
Definition: TrackingRecHit2DSOAView.h:80
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20