CMS 3D CMS Logo

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

#include <AtomicPairCounter.h>

Classes

struct  Counters
 
union  Packer
 

Public Types

using DoubleWord = uint64_t
 

Public Member Functions

template<typename TAcc >
ALPAKA_FN_ACC ALPAKA_FN_INLINE constexpr Counters add (const TAcc &acc, Counters c)
 
ALPAKA_FN_HOST_ACC constexpr AtomicPairCounter ()
 
ALPAKA_FN_HOST_ACC constexpr AtomicPairCounter (uint32_t first, uint32_t second)
 
ALPAKA_FN_HOST_ACC constexpr AtomicPairCounter (DoubleWord values)
 
ALPAKA_FN_HOST_ACC constexpr Counters get () const
 
template<typename TAcc >
ALPAKA_FN_ACC ALPAKA_FN_INLINE Counters constexpr inc_add (const TAcc &acc, uint32_t i)
 
ALPAKA_FN_HOST_ACC constexpr AtomicPairCounteroperator= (DoubleWord values)
 

Static Private Member Functions

static constexpr DoubleWord pack (uint32_t first, uint32_t second)
 

Private Attributes

Packer counter_
 

Detailed Description

Definition at line 10 of file AtomicPairCounter.h.

Member Typedef Documentation

◆ DoubleWord

Definition at line 12 of file AtomicPairCounter.h.

Constructor & Destructor Documentation

◆ AtomicPairCounter() [1/3]

ALPAKA_FN_HOST_ACC constexpr cms::alpakatools::AtomicPairCounter::AtomicPairCounter ( )
inline

Definition at line 14 of file AtomicPairCounter.h.

◆ AtomicPairCounter() [2/3]

ALPAKA_FN_HOST_ACC constexpr cms::alpakatools::AtomicPairCounter::AtomicPairCounter ( uint32_t  first,
uint32_t  second 
)
inline

Definition at line 15 of file AtomicPairCounter.h.

References dqmdumpme::first, pack(), and edm::second().

15 : counter_{pack(first, second)} {}
static constexpr DoubleWord pack(uint32_t first, uint32_t second)
U second(std::pair< T, U > const &p)

◆ AtomicPairCounter() [3/3]

ALPAKA_FN_HOST_ACC constexpr cms::alpakatools::AtomicPairCounter::AtomicPairCounter ( DoubleWord  values)
inline

Member Function Documentation

◆ add()

template<typename TAcc >
ALPAKA_FN_ACC ALPAKA_FN_INLINE constexpr Counters cms::alpakatools::AtomicPairCounter::add ( const TAcc &  acc,
Counters  c 
)
inline

Definition at line 32 of file AtomicPairCounter.h.

References cms::alpakatools::AtomicPairCounter::Packer::as_doubleword, cms::cudacompat::atomicAdd(), DummyCfis::c, counter_, pack(), and runTheMatrix::ret.

Referenced by inc_add(), and counter.Counter::register().

32  {
33  Packer value{pack(c.first, c.second)};
34  Packer ret{0};
35  ret.as_doubleword =
37  return ret.as_counters;
38  }
ret
prodAgent to be discontinued
static constexpr DoubleWord pack(uint32_t first, uint32_t second)
std::vector< Block > Blocks
Definition: Block.h:99
Definition: value.py:1
T1 atomicAdd(T1 *a, T2 b)
Definition: cudaCompat.h:61

◆ get()

ALPAKA_FN_HOST_ACC constexpr Counters cms::alpakatools::AtomicPairCounter::get ( ) const
inline

◆ inc_add()

template<typename TAcc >
ALPAKA_FN_ACC ALPAKA_FN_INLINE Counters constexpr cms::alpakatools::AtomicPairCounter::inc_add ( const TAcc &  acc,
uint32_t  i 
)
inline

Definition at line 42 of file AtomicPairCounter.h.

References add(), and mps_fire::i.

42  {
43  return add(acc, {1u, i});
44  }
ALPAKA_FN_ACC ALPAKA_FN_INLINE constexpr Counters add(const TAcc &acc, Counters c)

◆ operator=()

ALPAKA_FN_HOST_ACC constexpr AtomicPairCounter& cms::alpakatools::AtomicPairCounter::operator= ( DoubleWord  values)
inline

◆ pack()

static constexpr DoubleWord cms::alpakatools::AtomicPairCounter::pack ( uint32_t  first,
uint32_t  second 
)
inlinestaticprivate

Definition at line 57 of file AtomicPairCounter.h.

References dqmdumpme::first, runTheMatrix::ret, and edm::second().

Referenced by add(), and AtomicPairCounter().

57  {
58  Packer ret{0};
59  ret.as_counters = {first, second};
60  return ret.as_doubleword;
61  }
ret
prodAgent to be discontinued
U second(std::pair< T, U > const &p)

Member Data Documentation

◆ counter_

Packer cms::alpakatools::AtomicPairCounter::counter_
private

Definition at line 63 of file AtomicPairCounter.h.

Referenced by add(), get(), and operator=().