CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS > Class Template Reference

#include <HistoContainer.h>

Inheritance diagram for cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >:
cms::cuda::OneToManyAssoc< I, NHISTS *NBINS+1, SIZE >

Public Types

using Base = OneToManyAssoc< I, NHISTS *NBINS+1, SIZE >
 
using Counter = typename Base::Counter
 
using index_type = typename Base::index_type
 
using UT = typename std::make_unsigned< T >::type
 
using View = typename Base::View
 
- Public Types inherited from cms::cuda::OneToManyAssoc< I, NHISTS *NBINS+1, SIZE >
using Counter = uint32_t
 
using CountersOnly = OneToManyAssoc< I, ONES, 0 >
 
using index_type = I
 
using View = OneToManyAssocView< OneToManyAssoc< I, ONES, SIZE > >
 

Public Member Functions

__host__ __device__ __attribute__ ((always_inline)) void count(T t
 
__host__ __device__ __attribute__ ((always_inline)) void count(T t)
 
__host__ __device__ __attribute__ ((always_inline)) void fill(T t
 
__host__ __device__ __attribute__ ((always_inline)) void fill(T t
 
 assert (b< nbins())
 
 assert (b< nbins())
 
 assert (b< nbins())
 
 assert (b< totbins())
 
 assert (b< totbins())
 
 assert (w > 0)
 
 assert (w > 0)
 
 Base::atomicIncrement (this->off[b])
 
- Public Member Functions inherited from cms::cuda::OneToManyAssoc< I, NHISTS *NBINS+1, SIZE >
__host__ __device__ __attribute__ ((always_inline)) int32_t bulkFill(AtomicPairCounter &apc
 
__host__ __device__ __attribute__ ((always_inline)) void add(CountersOnly const &co)
 
__host__ __device__ __attribute__ ((always_inline)) void bulkFinalize(AtomicPairCounter const &apc)
 
__host__ __device__ __attribute__ ((always_inline)) void bulkFinalizeFill(AtomicPairCounter const &apc)
 
__host__ __device__ __attribute__ ((always_inline)) void count(int32_t b)
 
__host__ __device__ __attribute__ ((always_inline)) void fill(int32_t b
 
__host__ __device__ __attribute__ ((always_inline)) void final ize(Counter *ws
 
 assert (w > 0)
 
constexpr auto capacity () const
 
 for (uint32_t j=0;j< n;++j) content[c.n+j]
 
 if (int(c.m) >=nOnes()) return -int32_t(c.m)
 
__host__ __device__ void initStorage (View view)
 
constexpr auto nOnes () const
 
constexpr auto totOnes () const
 
__host__ __device__ void zero ()
 

Static Public Member Functions

static constexpr UT bin (T t)
 
static constexpr auto histOff (uint32_t nh)
 
static constexpr uint32_t ilog2 (uint32_t v)
 
static constexpr uint32_t nbins ()
 
static constexpr uint32_t nbits ()
 
static constexpr uint32_t nhists ()
 
static constexpr uint32_t sizeT ()
 
static constexpr uint32_t totbins ()
 
- Static Public Member Functions inherited from cms::cuda::OneToManyAssoc< I, NHISTS *NBINS+1, SIZE >
static __host__ __device__ __attribute__ ((always_inline)) uint32_t atomicDecrement(Counter &x)
 
static __host__ __device__ __attribute__ ((always_inline)) uint32_t atomicIncrement(Counter &x)
 
static constexpr int32_t ctCapacity ()
 
static constexpr int32_t ctNOnes ()
 
static constexpr uint32_t ilog2 (uint32_t v)
 

Public Attributes

 b = histOff(nh)
 
this content [w - 1] = j
 
__host__ __device__ index_type j
 
__host__ __device__ uint32_t nh
 
__host__ __device__ index_type uint32_t nh
 
auto w = Base::atomicDecrement(this->off[b])
 
- Public Attributes inherited from cms::cuda::OneToManyAssoc< I, NHISTS *NBINS+1, SIZE >
FlexiStorage< index_type, SIZEcontent
 
 content [w - 1]
 
__host__ __device__ index_type j
 
return c m
 
__host__ __device__ const index_type uint32_t n
 
__host__ __device__ ONES off
 
 off [c.m]
 
int32_t psws
 
__host__ __device__ const index_typev
 
auto w
 

Detailed Description

template<typename T, uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
class cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >

Definition at line 101 of file HistoContainer.h.

Member Typedef Documentation

◆ Base

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
using cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::Base = OneToManyAssoc<I, NHISTS * NBINS + 1, SIZE>

Definition at line 103 of file HistoContainer.h.

◆ Counter

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
using cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::Counter = typename Base::Counter

Definition at line 105 of file HistoContainer.h.

◆ index_type

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
using cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::index_type = typename Base::index_type

Definition at line 106 of file HistoContainer.h.

◆ UT

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
using cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::UT = typename std::make_unsigned<T>::type

Definition at line 107 of file HistoContainer.h.

◆ View

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
using cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::View = typename Base::View

Definition at line 104 of file HistoContainer.h.

Member Function Documentation

◆ __attribute__() [1/4]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
__host__ __device__ cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::__attribute__ ( (always_inline)  )
inline

◆ __attribute__() [2/4]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
__host__ __device__ cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::__attribute__ ( (always_inline)  )
inline

Definition at line 138 of file HistoContainer.h.

138  {
139  uint32_t b = bin(t);
140  assert(b < nbins());
141  Base::atomicIncrement(this->off[b]);
142  }

References cms::cuda::assert(), b, newFWLiteAna::bin, LaserClient_cfi::nbins, and submitPVValidationJobs::t.

◆ __attribute__() [3/4]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
__host__ __device__ cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::__attribute__ ( (always_inline)  )
inline

◆ __attribute__() [4/4]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
__host__ __device__ cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::__attribute__ ( (always_inline)  )
inline

◆ assert() [1/7]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::assert ( )

◆ assert() [2/7]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::assert ( )

◆ assert() [3/7]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::assert ( )

◆ assert() [4/7]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::assert ( )

◆ assert() [5/7]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::assert ( )

◆ assert() [6/7]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::assert ( w  ,
 
)

◆ assert() [7/7]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::assert ( w  ,
 
)

◆ Base::atomicIncrement()

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::Base::atomicIncrement ( this->  off[b])

◆ bin()

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
static constexpr UT cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::bin ( T  t)
inlinestaticconstexpr

Definition at line 132 of file HistoContainer.h.

132  {
133  constexpr uint32_t shift = sizeT() - nbits();
134  constexpr uint32_t mask = (1 << nbits()) - 1;
135  return (t >> shift) & mask;
136  }

References edm::shift, and submitPVValidationJobs::t.

Referenced by gpuPixelDoublets::for(), and gpuVertexFinder::while().

◆ histOff()

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
static constexpr auto cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::histOff ( uint32_t  nh)
inlinestaticconstexpr

Definition at line 130 of file HistoContainer.h.

130 { return NBINS * nh; }

References NBINS, and cms::cuda::nh.

Referenced by gpuPixelDoublets::for().

◆ ilog2()

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
static constexpr uint32_t cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::ilog2 ( uint32_t  v)
inlinestaticconstexpr

Definition at line 109 of file HistoContainer.h.

109  {
110  constexpr uint32_t b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
111  constexpr uint32_t s[] = {1, 2, 4, 8, 16};
112 
113  uint32_t r = 0; // result of log2(v) will go here
114  for (auto i = 4; i >= 0; i--)
115  if (v & b[i]) {
116  v >>= s[i];
117  r |= s[i];
118  }
119  return r;
120  }

References b, mps_fire::i, alignCSCRings::r, alignCSCRings::s, and cms::cuda::v.

◆ nbins()

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
static constexpr uint32_t cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::nbins ( )
inlinestaticconstexpr

Definition at line 123 of file HistoContainer.h.

123 { return NBINS; }

References NBINS.

Referenced by gpuVertexFinder::__attribute__(), gpuPixelDoublets::for(), and gpuVertexFinder::while().

◆ nbits()

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
static constexpr uint32_t cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::nbits ( )
inlinestaticconstexpr

Definition at line 126 of file HistoContainer.h.

126 { return ilog2(NBINS - 1) + 1; }

References trklet::ilog2(), and NBINS.

◆ nhists()

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
static constexpr uint32_t cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::nhists ( )
inlinestaticconstexpr

Definition at line 124 of file HistoContainer.h.

124 { return NHISTS; }

◆ sizeT()

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
static constexpr uint32_t cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::sizeT ( )
inlinestaticconstexpr

Definition at line 122 of file HistoContainer.h.

122 { return S; }

References S().

◆ totbins()

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
static constexpr uint32_t cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::totbins ( )
inlinestaticconstexpr

Definition at line 125 of file HistoContainer.h.

125 { return NHISTS * NBINS + 1; }

References NBINS.

Referenced by gpuVertexFinder::__attribute__().

Member Data Documentation

◆ b

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::b = histOff(nh)

Definition at line 155 of file HistoContainer.h.

◆ content

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
this cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::content = j

◆ j

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
__host__ __device__ index_type cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::j
Initial value:
{
uint32_t b = bin(t)

Definition at line 144 of file HistoContainer.h.

◆ nh [1/2]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
__host__ __device__ uint32_t cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::nh
Initial value:
{
uint32_t b = bin(t)

Definition at line 152 of file HistoContainer.h.

◆ nh [2/2]

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
__host__ __device__ index_type uint32_t cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::nh
Initial value:
{
uint32_t b = bin(t)

Definition at line 160 of file HistoContainer.h.

◆ w

template<typename T , uint32_t NBINS, int32_t SIZE, uint32_t S = sizeof(T) * 8, typename I = uint32_t, uint32_t NHISTS = 1>
auto cms::cuda::HistoContainer< T, NBINS, SIZE, S, I, NHISTS >::w = Base::atomicDecrement(this->off[b])

Definition at line 147 of file HistoContainer.h.

mps_fire.i
i
Definition: mps_fire.py:428
NBINS
const int NBINS
Definition: CaloCachedShapeIntegrator.cc:3
cms::cuda::HistoContainer::ilog2
static constexpr uint32_t ilog2(uint32_t v)
Definition: HistoContainer.h:109
cms::cuda::HistoContainer::assert
assert(b< nbins())
cms::cuda::OneToManyAssoc< I, NHISTS *NBINS+1, SIZE >::v
__host__ __device__ const index_type * v
Definition: OneToManyAssoc.h:232
alignCSCRings.s
s
Definition: alignCSCRings.py:92
cms::cuda::HistoContainer::nbits
static constexpr uint32_t nbits()
Definition: HistoContainer.h:126
cms::cuda::HistoContainer::nh
__host__ __device__ uint32_t nh
Definition: HistoContainer.h:152
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
cms::cuda::HistoContainer::sizeT
static constexpr uint32_t sizeT()
Definition: HistoContainer.h:122
alignCSCRings.r
r
Definition: alignCSCRings.py:93
cms::cuda::HistoContainer::nbins
static constexpr uint32_t nbins()
Definition: HistoContainer.h:123
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
cms::cuda::HistoContainer::bin
static constexpr UT bin(T t)
Definition: HistoContainer.h:132
cms::cuda::HistoContainer::b
b
Definition: HistoContainer.h:155
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
cms::cuda::HistoContainer::atomicIncrement
Base::atomicIncrement(this->off[b])
cms::cuda::OneToManyAssoc< I, NHISTS *NBINS+1, SIZE >::off
off[c.m]
Definition: OneToManyAssoc.h:236