Skip to content

Commit

Permalink
code foramt
Browse files Browse the repository at this point in the history
  • Loading branch information
VinInn committed Dec 6, 2020
1 parent 99e2a46 commit 0142a73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TrackingRecHit2DHeterogeneous {
auto hitsModuleStart() const { return m_hitsModuleStart; }
auto hitsLayerStart() { return m_hitsLayerStart; }
auto phiBinner() { return m_hist; }
auto binnerStorage() {return m_histStorage;}
auto binnerStorage() { return m_histStorage; }
auto iphi() { return m_iphi; }

// only the local coord and detector index
Expand All @@ -61,7 +61,7 @@ class TrackingRecHit2DHeterogeneous {

// needed as kernel params...
Hist* m_hist;
Hist::index_type * m_histStorage;
Hist::index_type* m_histStorage;
uint32_t* m_hitsLayerStart;
int16_t* m_iphi;
};
Expand Down Expand Up @@ -103,15 +103,15 @@ TrackingRecHit2DHeterogeneous<Traits>::TrackingRecHit2DHeterogeneous(uint32_t nH
m_store32 = Traits::template make_device_unique<float[]>(nHits * n32 + 11, stream);
m_HistStore = Traits::template make_device_unique<TrackingRecHit2DSOAView::Hist>(stream);

static_assert(sizeof(TrackingRecHit2DSOAView::hindex_type)==sizeof(float));
static_assert(sizeof(TrackingRecHit2DSOAView::hindex_type)==sizeof(TrackingRecHit2DSOAView::Hist::index_type));
static_assert(sizeof(TrackingRecHit2DSOAView::hindex_type) == sizeof(float));
static_assert(sizeof(TrackingRecHit2DSOAView::hindex_type) == sizeof(TrackingRecHit2DSOAView::Hist::index_type));

auto get16 = [&](int i) { return m_store16.get() + i * nHits; };
auto get32 = [&](int i) { return m_store32.get() + i * nHits; };

// copy all the pointers
m_hist = view->m_hist = m_HistStore.get();
m_histStorage = view->m_histStorage = reinterpret_cast<TrackingRecHit2DSOAView::Hist::index_type *>(get32(9));
m_histStorage = view->m_histStorage = reinterpret_cast<TrackingRecHit2DSOAView::Hist::index_type*>(get32(9));

view->m_xl = get32(0);
view->m_yl = get32(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class TrackingRecHit2DSOAView {
static constexpr uint32_t maxHits() { return gpuClustering::MaxNumClusters; }
using hindex_type = uint32_t; // if above is <=2^32

using PhiBinner =
cms::cuda::HistoContainer<int16_t, 128, -1, 8 * sizeof(int16_t), hindex_type, 10>;
using PhiBinner = cms::cuda::HistoContainer<int16_t, 128, -1, 8 * sizeof(int16_t), hindex_type, 10>;

using Hist = PhiBinner; // FIXME

Expand Down Expand Up @@ -96,7 +95,7 @@ class TrackingRecHit2DSOAView {
uint32_t* m_hitsLayerStart;

PhiBinner* m_hist; // FIXME use a more descriptive name consistently
PhiBinner::index_type * m_histStorage;
PhiBinner::index_type* m_histStorage;

uint32_t m_nHits;
};
Expand Down

0 comments on commit 0142a73

Please sign in to comment.