CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
cms::cuda::AtomicPairCounter Class Reference

#include <AtomicPairCounter.h>

Classes

union  Atomic2
 
struct  Counters
 

Public Types

using c_type = unsigned long long int
 

Public Member Functions

 __attribute__ ((always_inline)) Counters add(uint32_t i)
 
 AtomicPairCounter ()
 
 AtomicPairCounter (c_type i)
 
Counters get () const
 
AtomicPairCounteroperator= (c_type i)
 

Static Public Attributes

static constexpr c_type incr = 1UL << 32
 

Private Attributes

Atomic2 counter
 

Detailed Description

Definition at line 11 of file AtomicPairCounter.h.

Member Typedef Documentation

◆ c_type

using cms::cuda::AtomicPairCounter::c_type = unsigned long long int

Definition at line 13 of file AtomicPairCounter.h.

Constructor & Destructor Documentation

◆ AtomicPairCounter() [1/2]

cms::cuda::AtomicPairCounter::AtomicPairCounter ( )
inline

Definition at line 15 of file AtomicPairCounter.h.

15 {}

◆ AtomicPairCounter() [2/2]

cms::cuda::AtomicPairCounter::AtomicPairCounter ( c_type  i)
inline

Definition at line 16 of file AtomicPairCounter.h.

16 { counter.ac = i; }

References mps_fire::i.

Member Function Documentation

◆ __attribute__()

cms::cuda::AtomicPairCounter::__attribute__ ( (always_inline)  )
inline

Definition at line 38 of file AtomicPairCounter.h.

38  {
39  c_type c = i;
40  c += incr;
41  Atomic2 ret;
42 #ifdef __CUDA_ARCH__
43  ret.ac = atomicAdd(&counter.ac, c);
44 #else
45  ret.ac = counter.ac;
46  counter.ac += c;
47 #endif
48  return ret.counters;
49  }

References cms::cudacompat::atomicAdd(), HltBtagPostValidation_cff::c, mps_fire::i, incr, and runTheMatrix::ret.

◆ get()

Counters cms::cuda::AtomicPairCounter::get ( ) const
inline

◆ operator=()

AtomicPairCounter& cms::cuda::AtomicPairCounter::operator= ( c_type  i)
inline

Definition at line 18 of file AtomicPairCounter.h.

18  {
19  counter.ac = i;
20  return *this;
21  }

References mps_fire::i.

Member Data Documentation

◆ counter

Atomic2 cms::cuda::AtomicPairCounter::counter
private

Definition at line 52 of file AtomicPairCounter.h.

Referenced by counter.Counters::__getitem__().

◆ incr

constexpr c_type cms::cuda::AtomicPairCounter::incr = 1UL << 32
staticconstexpr

Definition at line 33 of file AtomicPairCounter.h.

Referenced by __attribute__().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
counter
Definition: counter.py:1
mps_fire.i
i
Definition: mps_fire.py:355
cms::cudacompat::atomicAdd
T1 atomicAdd(T1 *a, T2 b)
Definition: cudaCompat.h:39
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
cms::cuda::AtomicPairCounter::c_type
unsigned long long int c_type
Definition: AtomicPairCounter.h:13
cms::cuda::AtomicPairCounter::incr
static constexpr c_type incr
Definition: AtomicPairCounter.h:33