CMS 3D CMS Logo

Functions
hybridBitonicSortUtils Namespace Reference

Functions

unsigned int bitonicMergeLatencyRef (unsigned int nIn)
 
unsigned int bitonicSortLatencyRef (unsigned int nIn, unsigned int nOut)
 
template<typename T >
void clear (T &t)
 
template<typename T >
void compAndSwap (T a[], int i, int j, bool dir)
 
unsigned int hybridBitonicSortLatencyRef (unsigned int nIn, unsigned int nOut)
 
unsigned int PowerOf2LessThan (unsigned int n)
 

Function Documentation

◆ bitonicMergeLatencyRef()

unsigned int hybridBitonicSortUtils::bitonicMergeLatencyRef ( unsigned int  nIn)
inline

Definition at line 36 of file bitonic_hybrid_sort_ref.h.

References SiStripPI::max, l1ctLayer1_cff::nIn, and PowerOf2LessThan().

Referenced by bitonicSortLatencyRef(), and hybridBitonicSortLatencyRef().

36  {
37  if (nIn <= 1)
38  return 0;
39  return 1 +
41  }
unsigned int PowerOf2LessThan(unsigned int n)
unsigned int bitonicMergeLatencyRef(unsigned int nIn)

◆ bitonicSortLatencyRef()

unsigned int hybridBitonicSortUtils::bitonicSortLatencyRef ( unsigned int  nIn,
unsigned int  nOut 
)
inline

Definition at line 43 of file bitonic_hybrid_sort_ref.h.

References bitonicMergeLatencyRef(), SiStripPI::max, SiStripPI::min, l1ctLayer1_cff::nIn, and l1ctLayer1_cff::nOut.

43  {
44  if (nIn <= 1)
45  return 0;
46  unsigned int sort1Size = nIn / 2, sort2Size = nIn - sort1Size;
47  unsigned int sort1Latency = bitonicSortLatencyRef(sort1Size, nOut);
48  unsigned int sort2Latency = bitonicSortLatencyRef(sort2Size, nOut);
49  unsigned int mergeLatency = bitonicMergeLatencyRef(std::min(sort1Size, nOut) + std::min(sort2Size, nOut));
50  return std::max(sort1Latency, sort2Latency) + mergeLatency;
51  }
unsigned int bitonicSortLatencyRef(unsigned int nIn, unsigned int nOut)
unsigned int bitonicMergeLatencyRef(unsigned int nIn)

◆ clear()

template<typename T >
void hybridBitonicSortUtils::clear ( T t)

Definition at line 71 of file bitonic_hybrid_sort_ref.h.

References submitPVValidationJobs::t.

Referenced by folded_hybrid_bitonic_sort_and_crop_ref().

71  {
72  t.clear();
73  }

◆ compAndSwap()

template<typename T >
void hybridBitonicSortUtils::compAndSwap ( T  a[],
int  i,
int  j,
bool  dir 
)

Definition at line 26 of file bitonic_hybrid_sort_ref.h.

References a, DeadROC_duringRun::dir, mps_fire::i, dqmiolumiharvest::j, and std::swap().

Referenced by hybridBitonicMergeRef(), and hybridBitonicSortRef().

26  {
27  if (dir) {
28  if (a[j] < a[i])
29  std::swap(a[i], a[j]);
30  } else {
31  if (a[i] < a[j])
32  std::swap(a[i], a[j]);
33  }
34  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
double a
Definition: hdecay.h:119

◆ hybridBitonicSortLatencyRef()

unsigned int hybridBitonicSortUtils::hybridBitonicSortLatencyRef ( unsigned int  nIn,
unsigned int  nOut 
)
inline

Definition at line 53 of file bitonic_hybrid_sort_ref.h.

References bitonicMergeLatencyRef(), SiStripPI::max, SiStripPI::min, l1ctLayer1_cff::nIn, and l1ctLayer1_cff::nOut.

53  {
54  if (nIn <= 1)
55  return 0;
56  if (nIn == 5 || nIn == 6)
57  return 3;
58  if (nIn == 12)
59  return 8;
60  if (nIn == 13)
61  return 9;
62  unsigned int sort1Size = nIn / 2, sort2Size = nIn - sort1Size;
63  unsigned int sort1Latency = hybridBitonicSortLatencyRef(sort1Size, nOut);
64  unsigned int sort2Latency = hybridBitonicSortLatencyRef(sort2Size, nOut);
65  unsigned int mergeLatency = bitonicMergeLatencyRef(std::min(sort1Size, nOut) + std::min(sort2Size, nOut));
66  return std::max(sort1Latency, sort2Latency) + mergeLatency;
67  }
unsigned int hybridBitonicSortLatencyRef(unsigned int nIn, unsigned int nOut)
unsigned int bitonicMergeLatencyRef(unsigned int nIn)

◆ PowerOf2LessThan()

unsigned int hybridBitonicSortUtils::PowerOf2LessThan ( unsigned int  n)
inline

Definition at line 8 of file bitonic_hybrid_sort_ref.h.

References cms::cuda::assert(), mps_fire::i, and dqmiodumpmetadata::n.

Referenced by bitonicMergeLatencyRef(), and hybridBitonicMergeRef().

8  {
9  unsigned int i = 1;
10  unsigned int prev = 1;
11  if (n <= 1)
12  return n;
13  while (i < n) {
14  i <<= 1;
15  if (i < n) {
16  prev = i;
17  } else {
18  return prev;
19  }
20  }
21  // shouldn't happen
22  assert(false);
23  }
assert(be >=bs)